Posted July 11, 201510 yr Hi, tried doing a search for re-write rules for nginx but couldn't find a solid consensus. Anyone know what I should be using? currently I have the following: location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.php?$args; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules }
July 11, 201510 yr location / { try_files $uri $uri/ /index.php; } location ~^(/page/).*(.php)$ { try_files $uri $uri/ /index.php; }That is what is in my "site-available" config file for the forum, and friendly URLs are working.
July 14, 20159 yr location / { try_files $uri $uri/ /index.php; } location ~^(/page/).*(.php)$ { try_files $uri $uri/ /index.php; }That is what is in my "site-available" config file for the forum, and friendly URLs are working.Friendly URL's display correctly, but a 404 file/path results in a loop. For example, www.mysite123123.com/this-url-doesnt-exist results in a redirect loop. What about you? What should happen is like what happens on this site:https://community.invisionpower.com/123123123
July 21, 20159 yr location / { try_files $uri $uri/ /index.php; } location ~^(/page/).*(.php)$ { try_files $uri $uri/ /index.php; }That is what is in my "site-available" config file for the forum, and friendly URLs are working.Strange, when adding this to my nginx config it appears to break the URL structure.Forums are linked on the index as: https://mydevsiteurl/forums/forum/2-an-example-forum/ ... shouldn't it be just, "https://mydevsiteurl/forum/2-an-example-forum/" Why is it showing FORUMS instead of forum in the URL? My IPB3 install is siteurl.tld/forum/this-is-a-forum . I'd submit a ticket asking this but they will not provide support for test installs, only live installs.
July 21, 20159 yr Ignore the above post. Got that figured out (had to change the URL structure in the Advanced Configuration --> Friendly URLs to remove all mentions of "forums" from the rewritten URLs. Now a new problem. For some reason the configuration and rewrite rules still require the 'index.php' to be part of the URL... any idea on how to fix this?
July 21, 20159 yr Ignore the above post. Got that figured out (had to change the URL structure in the Advanced Configuration --> Friendly URLs to remove all mentions of "forums" from the rewritten URLs. Now a new problem. For some reason the configuration and rewrite rules still require the 'index.php' to be part of the URL... any idea on how to fix this?Have you enabled "Rewrite URLs" in System > Search Engine Optimisation?
July 21, 20159 yr Have you enabled "Rewrite URLs" in System > Search Engine Optimisation? When I do that, I get a 404 error with the rewrite rules mentioned in this thread.Otherwise they 'work' with that disabled but it prints index.php in the URL structure if I have that setting disabled. Edited July 21, 20159 yr by vpsBoard
July 21, 20159 yr When I do that, I get a 404 error with the rewrite rules mentioned in this thread.Otherwise they 'work' with that disabled but it prints index.php in the URL structure if I have that setting disabled. I setup my forum as the 'root' for IPB, it looks like maybe you have it set differently which is why you had a nested site.com/forum/forum URL structure. I'm not certain, still new to IPB.
July 21, 20159 yr Nope, in the root dir. Dev site is https://ipb4.vpsb.in/ and is in the root dir. (/var/www/html)
Archived
This topic is now archived and is closed to further replies.