I’d like to host a WordPress site at http://example.com/content.

My main site is a Meteor site at example.com with nginx in front of it.

This is my nginx config file, but http://example.com/content is just being redirected to https://example.com/content and completely ignoring the /content location block. Any idea how to fix this?

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html; # root is irrelevant
    index index.html index.htm; # this is also irrelevant

    server_name example.com;

    location /content/ {
        proxy_pass; #wordpress ip
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # redirect non-SSL to SSL
    location / {
        rewrite     ^ https://$server_name$request_uri? permanent;

Read more here: Nginx redirect for one path (wordpress)


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: