nginx_php
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
nginx_php [20.04.2025 08:56] – augin | nginx_php [19.05.2025 06:52] (текущий) – [nginx] augin | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | ====== install ====== | ||
+ | |||
<code bash> | <code bash> | ||
opkg install nginx | opkg install nginx | ||
Строка 11: | Строка 13: | ||
opkg install php8-mod-dom | opkg install php8-mod-dom | ||
opkg install php8-mod-gd | opkg install php8-mod-gd | ||
+ | opkg install php8-mod-intl | ||
</ | </ | ||
Строка 99: | Строка 102: | ||
/ | / | ||
</ | </ | ||
+ | |||
+ | ====== nginx ====== | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | server { | ||
+ | server_tokens off; | ||
+ | server_name YOU_DOMAIN *.YOU_DOMAIN; | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | listen 443 ssl http2; | ||
+ | listen [::]:443 ssl http2; | ||
+ | #http2 on; http3 on; | ||
+ | index index.html index.htm index.php index.nginx-debian.html; | ||
+ | root / | ||
+ | ssl_protocols TLSv1.2 TLSv1.3; | ||
+ | ssl_ciphers HIGH: | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | if ($host !~* ^(.+\.)? | ||
+ | if ($scheme ~* https) {set $safe 1;} | ||
+ | if ($ssl_server_name !~* ^(.+\.)? | ||
+ | if ($safe = 10){return 444;} | ||
+ | if ($request_uri ~ " | ||
+ | error_page 400 402 403 500 501 502 503 504 =404 /404; | ||
+ | proxy_intercept_errors on; | ||
+ | #X-UI Admin Panel | ||
+ | location / | ||
+ | #auth_basic " | ||
+ | # | ||
+ | proxy_redirect off; | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_pass http:// | ||
+ | break; | ||
+ | } | ||
+ | # | ||
+ | location ~ ^/ | ||
+ | if ($hack = 1) {return 404;} | ||
+ | proxy_redirect off; | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_pass http:// | ||
+ | break; | ||
+ | } | ||
+ | # | ||
+ | location ~ ^/ | ||
+ | if ($hack = 1) {return 404;} | ||
+ | proxy_redirect off; | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_pass http:// | ||
+ | break; | ||
+ | } | ||
+ | #Xray Config Path | ||
+ | location ~ ^/ | ||
+ | if ($hack = 1) {return 404;} | ||
+ | #if ($cloudflare_ip != 1) {return 404;} | ||
+ | #if ($http_cf_ipcountry !~* " | ||
+ | #if ($http_user_agent ~* " | ||
+ | client_max_body_size 0; | ||
+ | client_body_timeout 1d; | ||
+ | grpc_read_timeout 1d; | ||
+ | grpc_socket_keepalive on; | ||
+ | proxy_read_timeout 1d; | ||
+ | proxy_http_version 1.1; | ||
+ | proxy_buffering off; | ||
+ | proxy_request_buffering off; | ||
+ | proxy_socket_keepalive on; | ||
+ | proxy_set_header Upgrade $http_upgrade; | ||
+ | proxy_set_header Connection " | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | if ($content_type ~* " | ||
+ | proxy_pass http:// | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ |
nginx_php.1745139375.txt.gz · Последнее изменение: — augin