I have an ubuntu vps.
I have set a domain and running an app by nginx on the domain route: example.com.
Now want to have a wordpress blog by installing on subdirectory by nginx with this route:
example.com/blog.
What should I do to solve this problem?
server {
server_name example.com;
gzip on;
gzip_proxied any;
gzip_types application/javascript application/x-javascript text/css text/javascript;
gzip_comp_level 5;
gzip_buffers 16 8k;
gzip_min_length 256;
location /_next/static/ {
alias /home/username/apps/my-app/.next/static/;
expires 365d;
access_log off;
}
location / {
proxy_pass http://localhost:3000; #change to 3001 for second app, but make sure second nextjs app starts on new port in packages.json "start": "next start -p 3001",
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 /blog {
# what should I do or add what block to solve my problem and have the wordpress on subdirectory?
}
}
I am able to do it on a domain-route or subdomain; But is not possible for me personally, to do what do I want.
Please help me to solve, if you know something… Thanks!