Question
Disable HTTPS redirect in NGINX
Hi,
I have been trying to disable HTTPS redirect in NGINX but just couldn’t. My current NGINX configuration is:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.html;
server_name blog.gollahalli.me;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:2368;
proxy_redirect off;
}
}
server {
listen 443 ssl;
server_name blog.gollahalli.me; # Replace with your domain
root /usr/share/nginx/html;
index index.html index.htm;
ssl on;
ssl_certificate /root/blog.gollahalli.me.chained.crt;
ssl_certificate_key /root/blog.gollahalli.me.key;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2368;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
I have tried removing the listen 443
, but I get page not found. What am I doing wrong here? I don’t see any redirect URL here.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×