Integrate additional Wordpress Sites into the NGINX container

Hi,

I’m trying to integrate an additional Wordpress installation that is running on our server to run alongside the tutor installation. I read that I can deactivate the nginx and caddy container that tutor provides and let the nginx container listen on port 81. I did that and tried to integrate tutor then into the local installation of nginx, but unfortunately that failed.

After that I tried it the other way around by deactivating the local nginx installation and trying to integrate the wordpress installation into the nginx container. Unfortunately that also failed, as now the wordpress installation became a subpage of the tutor domain.

Is there a possible way to achieve this? I’m running the wordpress installation on port 8080 to avoid the conflict on having both sites on port 80.

Any help on that matter would be really great.

1 Like

I managed to do it by disabling the nginx container like it is described in the docs:

tutor config save --set RUN_CADDY=false --set NGINX_HTTP_PORT=81

After that I purged and reinstalled nginx on the server and added the following conf:

server {
    listen 80;
    server_name example.com www.example.com;
    location / {
        proxy_pass http://127.0.0.1:81;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    }
}


server {
    listen 80;
    server_name studio.example.com;
    location / {
        proxy_pass http://127.0.0.1:81;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    }
}

server {
    listen 80;
    server_name wordpress-site.com www,wordpress-site.com;
    location / {
        proxy_pass http://127.0.0.1:8081;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    }
}

Afterwards I ran certbot and now both sites are working.

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.