diff --git a/docs/02-install/02-server.md b/docs/02-install/02-server.md index 9a1a765..b84dcf4 100644 --- a/docs/02-install/02-server.md +++ b/docs/02-install/02-server.md @@ -78,18 +78,28 @@ php think p:server {action} {--daemon} ### Nginx参考 ```nginx -location / { - try_files $uri $uri/ @backend; +upstream backend{ + server 127.0.0.1:8008; + keepalive 10240; } -location @backend { - proxy_pass http://127.0.0.1:8008; - 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_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; +server{ + listen 80; + server_name tp.xxx.cn; + root /xp/www/tp/public; + access_log off; + + location / { + proxy_pass http://backend; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header REMOTE-HOST $remote_addr; + 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_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; } ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/02-install/02-server.md b/i18n/en/docusaurus-plugin-content-docs/current/02-install/02-server.md index 001ea67..df81caf 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/02-install/02-server.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/02-install/02-server.md @@ -82,18 +82,28 @@ php think p:server {action} {--daemon} ### Nginx Reference ```nginx -location/{ - try_files $uri $uri/ @backend; +upstream backend{ + server 127.0.0.1:8008; + keepalive 10240; } -location @backend { - proxy_pass http://127.0.0.1:8008; - 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_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; +server{ + listen 80; + server_name tp.xxx.cn; + root /xp/www/tp/public; + access_log off; + + location / { + proxy_pass http://backend; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header REMOTE-HOST $remote_addr; + 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_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; } ```