I have included the rewrite rules in the Nginx server block for the Trident site but still getting 404 errors when trying to view pages. I am thinking that I have an issue with the Trident rewrites for Nginx. Is anyone else running Trident on Nginx? What about you Boonex? Geeks, making the world a better place |
I tried to disabled the pretty links but still have it doing the /page/about in the URL with it returning 404. Boonex, you need to think about Nginx as you work on Trident. Geeks, making the world a better place |
location /path_to_trident {
index index.html index.htm index.php;
# pages rewrite
rewrite "^/path_to_trident/page/(.*)$" /path_to_trident/page.php?i=$1 last;
# modules rewrite
rewrite "^/path_to_trident/m/(.*)$" /path_to_trident/modules/index.php?r=$1 last;
# storage
rewrite "^/path_to_trident/storage/([a-zA-Z0-9]+)/([a-zA-Z0-9\.]+)" /path_to_trident/storage.php?o=$1&f=$2 last;
}
Rules → http://www.boonex.com/terms |
location /path_to_trident {
index index.html index.htm index.php;
# pages rewrite
rewrite "^/path_to_trident/page/(.*)$" /path_to_trident/page.php?i=$1 last;
# modules rewrite
rewrite "^/path_to_trident/m/(.*)$" /path_to_trident/modules/index.php?r=$1 last;
# storage
rewrite "^/path_to_trident/storage/([a-zA-Z0-9]+)/([a-zA-Z0-9\.]+)" /path_to_trident/storage.php?o=$1&f=$2 last;
}
Thanks Alex. However, I see no difference as I examine your rewrites. I will continue to explore; it could be the way I have the server set up. What is the difference between Dolphin on Nginx and Trident on Nginx? I have been running Dolphin on Nginx since I first started using 7.1.0 when it was released.
Geeks, making the world a better place |
Is anyone else running Trident on Nginx?
I'm trying today to setup my nginx server, nginx is still new to me.
I'm trying to install T8B1 in a subfolder, how do I add the rewrite to the sites-enabled file?
Add the lines, or add a new section like the example given?
ManOfTeal.COM a Proud UNA site, six years running strong! |
I have been running Dolphin on Nginx since I first started using 7.1.0 when it was released.
I've been running a 7.1.x site for a year now on Nginx with great performance so far.
ManOfTeal.COM a Proud UNA site, six years running strong! |
With just a few rules in Trident, you can just add them in a location block in the server block. However, I tend to keep the rewrites in an external file and use an include to add them to the server block. I don't set my nginx up like others; I don't use sites-enabled etc; I simply have a sites directory and if I want to take a site out I change the extension and reload nginx. I always test the nginx config before restarting just to make sure that I can restart nginx.
I set trident up as a subdomain in a regular directory under my public_html; it is sitting just as any of the Dolphin sites are sitting on my server. Unless Trident is doing something differently than Dolphin, my location should be as my Dolphin site's location; in other words, sitting as root..
Geeks, making the world a better place |
Is it in a subfolder off of a site? Your location then might be /subfolder-name. It depends on how Nginx is set up on your server.
If you do a config test first, Nginx will let you know if you have an error in the nginx config.
Geeks, making the world a better place |
OK, this is what is in my trident-rewrites.inc file
# pages rewrite
rewrite "^/page/(.*)$" /page.php?i=$1 last;
# modules rewrite
rewrite "^/m/(.*)$" /modules/index.php?r=$1 last;
# storage
rewrite "^/storage/([a-zA-Z0-9]+)/([a-zA-Z0-9\.]+)" /storage.php?o=$1&f=$2 last;
I load the trident-rewrites.inc into the server block
#Trident Rewrite Rules location / { include trident-rewrites.inc; }
As I said, it is going to depend on how you set things up on your server.
A check for pages works now; modules have yet to be installed.
Geeks, making the world a better place |
I will expand a bit on my setup.
In the nginx.conf
# Load virtual host configuration files. include /sites/*.conf;
So any file that does not end in .conf will not be loaded. So instead of the sites-available and sites-enabled, it is just sites. If I want to take a config out of loading, I just rename and restart nginx. I don't have to go through all that symbolic links stuff. I believe in the KISS principle.
Geeks, making the world a better place |
I had to leave a while..
Thanks for the info.
My test site is in a folder of my main site.
I didn't setup my server, Prashank did and I never touched it since, that's been over a year.
ManOfTeal.COM a Proud UNA site, six years running strong! |
Thanks GG and AlexT, I was finally able to get this done. ManOfTeal.COM a Proud UNA site, six years running strong! |