feat: configure SSL and HTTP to HTTPS redirection in Nginx configuration
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 27s

This commit is contained in:
vickytechkey 2026-10-03 18:35:37 +05:30
parent 9fc5d3813b
commit 101d6610ff

View file

@ -1,5 +1,4 @@
server { server {
listen 80;
server_name betaapicsa.tradhox.com apicsa.tradhox.com; server_name betaapicsa.tradhox.com apicsa.tradhox.com;
location / { location / {
@ -21,4 +20,22 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/betaapicsa.tradhox.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/betaapicsa.tradhox.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = apicsa.tradhox.com) {
return 301 https://$host$request_uri;
}
if ($host = betaapicsa.tradhox.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name betaapicsa.tradhox.com apicsa.tradhox.com;
return 404;
} }