By renepeter18
The guide followed was here: https://www.digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache
I’ve setup everything and modified some other stuff to my liking, however as stated by another user, a fresh Wordpress install gives a redirect loop error on the index page. The dashboard works fine. To get around that error, I had to add remove_filter(‘template_redirect’, ‘redirect_canonical’); to the theme’s functions.php file.
Now I try to enable friendly urls with the .htaccess and it doesn;t work, it just reloads the same page no matter what I click. Is there something I’m missing?
My Nginx server block: https://paste8.com/KPMSQwXN My Apache vhost: https://paste8.com/q6BwHube
Any help is appreciated.
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!
Your try_files changes the URL to /index.php in order to send it upstream which looses the pretty permalink.
You might try to send the pretty permalink upstream by adding a named location. Maybe:
location / { try_files $uri $uri/ @proxy; }
location @proxy { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } location ~ .php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; }
font https://serverfault.com/questions/755759/mod-rewrite-issue-apache-behind-nginx
Fixed the issue myself. <br> <br>New Nginx config: https://paste8.com/AetMDiCe
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.