Hi @mmolinag,
I'm glad you managed to fix your NGINX config!
I'm afraid I was not able to reproduce your issue. I launched a fresh new server and I updated the /opt/bitnami/nginx/conf/bitnami.conf
file like below
# HTTP server
server {
listen 80;
server_name localhost;
# Send every HTTP request to HTTPS and my non-www domain
return 301 https://gonzalo-main.dev.closedstack.org$request_uri;
#include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";
include "/opt/bitnami/nginx/conf/bitnami/bitnami-apps-prefix.conf";
}
# HTTPS server
server {
listen 443 ssl;
server_name localhost;
# If host isn't my non-www domain, redirect to non-www
if ($host != "gonzalo-main.dev.closedstack.org") {
return 301 https://gonzalo-main.dev.closedstack.org$request_uri;
}
I restarted NGINX and it worked just fine for me
sudo /opt/bitnami/ctlscript.sh restart nginx
I checked your latest bnsuport bundle and I saw the next configuration for NGINX and HTTP
server {
listen 80;
server_name localhost;
if ($host != "www.example.com") {
return 301 https://example.com$request_uri;
}
}
As you can see, you are checking if the hostname included in the requests is not www.example.com
, which is wrong. Using the configuration I provided you above with your domain name should work.