I am having an odd issue. I configured a SSL proxy with Nginx serving a website in HTTP which is on 127.0.0.1:1195 (example.com is in my hosts pointing to 127.0.0.1). For some reason :
https://example.com:8765
doesn't work and gives ERR_NAME_NOT_RESOLVED- while
https://www.example.com:8765
works - and
https://ipaddress:8765
works as well.
What did I do wrong? Here is my nginx configuration
server {
listen 8765 ssl;
server_name example.com;
error_log /var/log/nginx/service.log;
ssl on;
ssl_certificate /etc/nginx/certificate.crt;
ssl_certificate_key /etc/nginx/certificate.key;
ssl_dhparam /etc/nginx/dhparams.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+$
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, n$
location / {
gzip off;
proxy_set_header X-Forwarded-Ssl on;
client_max_body_size 50M;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_for$
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://example.com:1195;
}
}