1 回答

TA貢獻2036條經驗 獲得超8個贊
經過一些錯誤和試驗后,它的工作原理
server {
listen 80;
server_name test.example.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /favicon.ico { alias /path/to/favicon.ico; }
listen 443 ssl http2;
#ssl info removed
}
一些要點
從服務器中刪除根目錄
刪除索引 {我們不需要索引,因為 ReactPhp 有自己的服務器}
將proxy_pass端口與 ReactPhp 服務器端口匹配
最好通過代理提供 SSL 與 nginx { 作為反應應用程序文檔}
502 網關錯誤 { 發生這種情況是因為我的服務器當時沒有運行}
添加回答
舉報