By Traktuner
Hello, I am troubleshooting this for a long time now, but I can’t find a solution by myself - hope you can help me. I installed the Wordpress package on my Synology NAS, which serves Wordpress on http://192.168.0.101/wordpress
Now I want to access the site from the internet - therefore I set up a reverse proxy with Nginx - I use this proxy for some internal sites, everything works except Wordpress, where it ends either in an redirect loop, or a “page not found” Wordpress site.
Wordpress is hosted on the Synology Nas with no SSL, because I want that the SSL encryption is served by the reverse proxy, so that I don’t need to install the certificate on the Synology Nas.
I already tried to disable Wordpress redirecting with remove_filter(‘template_redirect’,‘redirect_canonical’); in the theme functions.php, but no success.
Thank you in advance for your much appreciated help!
My Wordpress website address is set to: https://blog.mydomain.com/wordpress
My Nginx config for this subdomain part:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
index index.php;
server_name blog.mydomain.com;
# reverse proxy
location / {
proxy_pass http://192.168.0.101/wordpress/;
include nginxconfig.io/proxy.conf;
}
# SSL
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mydomain.com/chain.pem;
proxy_ssl_session_reuse on;
proxy_ssl_verify on;
}
#Forward HTTP to HTTPS
server {
listen 80;
listen [::]:80;
server_name blog.mydomain.com;
return 301 https://$server_name$request_uri;
}
NGINXCONFIG.IO proxy.conf
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
If you visit http://192.168.0.101/wordpress via your local network, does it work as expected?
If so, try updating the config a little bit to match your site and home URLs in your WordPress installation:
# reverse proxy
location /wordpress {
proxy_pass http://192.168.0.101/wordpress/;
include nginxconfig.io/proxy.conf;
}
Let me know how it goes! Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.