大家好
想請問為什麼在設定Nginx反向代理SSL後 網站變得很慢
尤其是上傳檔案 即便是1MB、2MB的檔案也是
想問說是不是設定上有誤
以下是Nginx設定
server {
listen 80;
server_name domain.com.tw www.domain.com.tw;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name domain.com.tw www.domain.com.tw;
upload_max_filesize = 2048M;
post_max_size = 2048M;
max_execution_time = 200;
location / {
proxy_pass http://原本網站的ip位址;
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 $http_x_forwarded_proto;
}
}
請參考以下方法:
方法一.
執行以下操作: remove proxy_cache nginx-cache;, remove用以下值proxy_buffering Off;替換內容:proxy.conf
https://serverfault.com/questions/796735/nginx-reverse-proxy-is-slow/796740方法二.
Very Slow Reverse Proxy on Nginx(地毯式一條條確認)
https://serverfault.com/questions/896914/very-slow-reverse-proxy-on-nginx/896963