Closed R-Josef closed 3 years ago
It should work lol
Remove this line: index index.html;
and use proxy_set_header Connection 'upgrade';
So like (as an example):
server {
listen 80;
server_name holyub.xxxxx.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /root/.acme.sh/*.xxxxx.com/fullchain.cer;
ssl_certificate_key /root/.acme.sh/*.xxxxx.com/*.xxxxx.com.key;
server_name holyub.xxxxx.com;
location / {
proxy_pass http://localhost:8080;
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;
}
}
Thanks for your reply, after I tried the configuration you gave and it didn't work, I realized that the problem was not with nginx, after many tests, I finally found out where the problem was: our government has banned ips in some areas and hijacked the traffic of these ips. So when I enable ssl and visit this website, the browser will return ERR_CONNECTION_RESET, it can be seen how important this proxy program is to people like me, thank you for your work.
Now I changed my VPS and it is normal.
Oh okay. Sorry about that though.
I want to use nginx for proxy because I have other websites. I tried many configurations but none of them worked:
None of the above configurations work, what should I do?