1

I'm trying to install a ghost blog along an express app on an nginx server.

The blog is supposed to run in the /blog subdirectory, express will handle all the other routing on /*

Right now setup seems to be working as the ghost process gets the requests, but I'm having a redirect loop.

What's wrong?

    server {
        listen 80;
        server_name url.io www.url.io;
        return 301 https://url.io$request_uri;
    }

    server {
        listen 443 ssl;
        server_name www.url.io;
        return 301 https://url.io$request_uri;
            ssl_certificate /etc/letsencrypt/live/url.io/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/url.io/privkey.pem;
    }

    server {
            listen 443 ssl;
            server_name url.io;

            ssl_certificate /etc/letsencrypt/live/url.io/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/url.io/privkey.pem;

            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_prefer_server_ciphers on;
            ssl_dhparam /etc/ssl/certs/dhparam.pem;
            ssl_ciphers 'STRING'
            ssl_session_timeout 1d;
            ssl_session_cache shared:SSL:50m;
            ssl_stapling on;
            ssl_stapling_verify on;
            add_header Strict-Transport-Security max-age=15768000;

            location / {
                    proxy_pass http://127.0.0.1:8080;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection 'upgrade';
                    proxy_set_header Host $host;
                    proxy_cache_bypass $http_upgrade;
                    try_files $uri $uri/ /index.html =404;
            }

            location /blog {
                    proxy_pass http://127.0.0.1:2368;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection 'upgrade';
                    proxy_set_header Host $host;
                    proxy_cache_bypass $http_upgrade;
            }

            location ~ /.well-known {
                    allow all;
            }
   }
HBruijn
  • 72,524
  • 21
  • 127
  • 192
Seb
  • 131
  • 4

1 Answers1

2

Ok I found it in the ghost config:

Problem was that I had https in the production:

 production: {
    url: 'https://url.io/blog'
}

Changing the url to http did the trick... strange but true.

Seb
  • 131
  • 4