Report this

What is the reason for this report?

How do I add a Wordpress Install to "/blog" on my server when "/" serves a different app via NGINX?

Posted on June 16, 2017

I have a Django app served at “domain.com/” I want to serve a Wordpress install from “domain.com/blog” so that I can enable SSL for both.

All I ever get is a 404 not found on the “/blog” entry. My NGINX conf file is shown below.

server { listen 80; listen [::]:80; server_name domain.org www.domain.org; return 301 https://$server_name$request_uri; }

server {

# SSL configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.domain.org domain.org;
include snippets/ssl-domain.org.conf;
include snippets/ssl-params.conf;

access_log /home/user/logs/nginx/nginx-access.log;
error_log  /home/user/logs/nginx/nginx-error.log;

client_max_body_size 4G;

root /home/user/app;

keepalive_timeout 5;

location = /favicon.ico { access_log off; log_not_found off; }

location /static {
    alias /home/user/app/static;
}


location /uploads {
    alias /home/user/uploads;
}

error_page 500 502 503 504 /500.html;
location = /500.html {
    alias /home/user/app/app/app/templates;
}

location / {
    include proxy_params;
    proxy_pass http://unix:/home/user/app/mosaic.sock;
}

location ~ /.well-known {
    allow all;
}

location /blog {
    try_files $uri $uri/ /index.php$is_args$args;
}

}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.