Answer the question
In order to leave comments, you need to log in
Is it possible to disable https on a specific address?
There is something like this config:
server {
listen 80 default_server;
server_name example.org;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl default_server;
ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
root /home/deploy/apps/example/current/public;
try_files $uri/index.html $uri @example;
location @example {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://example;
}
keepalive_timeout 10;
}
Answer the question
In order to leave comments, you need to log in
add location example to the first server section and set it to /non_https/
server {
listen 80 default_server;
server_name example.org;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl default_server;
ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
root /home/deploy/apps/example/current/public;
try_files $uri/index.html $uri @example;
location @example {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://example;
}
keepalive_timeout 10;
}
server {
listen 80 ;
server_name example_no_ssl.org;
location / {
......
}
.....
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question