Nginx customization not working on new DA installation

klasje

Verified User
Joined
Jan 5, 2008
Messages
52
I have a DA server that is about 3 years old and I'm now doing a clean install on a new server.
Both run on nginx, installed via custombuild.
Custombuild both has the latest versions installed, so the servers should be identical.

On the new DA installation, my nginx customizations however no longer require me to use "fastcgi_pass unix:/usr/local/php56/sockets/xxx.sock;"

However, when I restore the backup from the old server to the new server.
The homepage is working, but all subpages like domain.com/Thread/123-article/ are no longer working and are returning a 404 error.

I tried removing the last part ( location ~ [^/]\.php(/|$) { )
Then I don't get a 404, but still the correct pages won't load.

Do any of you know what changed in directadmin and how the new customization for fastcgi_pass should look like?

#Downloads rewrite ^/database/(.*)/([0-9]+)-(.*)/index.html /filebase/Entry/$2-$3/ permanent; #User profiles rewrite ^/user/([0-9]+)/(.*)/$ /User/$1-$2/ permanent; #Incoming linkpartners rewrite ^/in/(.*)$ / permanent; # Sitemaps plugin location /sitemap.xml { try_files $uri $uri/ /wcf/sitemaps/sitemap.xml; } #if ($request_uri !~ .*index\.php.* ) { if ($request_uri !~ (.*index\.php.*|/acp/js/.*)$ ) { rewrite ^/blog/Entry/(.*)$ /blog/index.php/Entry/$1/ break; rewrite ^/blog/(.*)/$ /blog/index.php/$1/ break; rewrite ^/cms/(.*)/$ /cms/index.php/$1/ break; rewrite ^/filebase/(.*)/$ /filebase/index.php/$1/ break; rewrite ^/Board/(.*)/$ /index.php/Board/$1/ break; rewrite ^/User/(.*)/$ /index.php/User/$1/ break; rewrite ^/Thread/(.*)/$ /index.php/Thread/$1/ break; rewrite ^/Thread/(.*)$ /index.php/Thread/$1/ break; rewrite ^/ThreadAdd/(.*)/$ /index.php/ThreadAdd/$1/ break; rewrite ^/SearchResult/(.*)/$ /index.php/SearchResult/$1 break; rewrite ^/([a-zA-Z]*)/(.*)/$ /index.php/$1/$2/ break; rewrite ^/([a-zA-Z]*)/$ /index.php/$1 break; } #proxy_intercept_errors on; #error_page 404 /cms/Page/; #?alias=404; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_read_timeout 300; fastcgi_pass unix:/usr/local/php56/sockets/ictsnew.sock; fastcgi_index index.php; include fastcgi_params; }

Thank you and happy newyear!
 
Update:
somehow following rule is now matching:
"(.*index\.php.*|/acp/js/.*)$" matches "/index.php/Thread/21213

Even though it should not match, there is a ! in there...
This used to work.

if ($request_uri !~ (.*index\.php.*|/acp/js/.*)$ ) {


But maybe the log line matches means it will skip it?


Further down the logs:
/home/user/domains/domain.com/public_html/index.php/Thread/21213-naam-voor-site/index.php" is not found (20: Not a directory)

So somehow he still keeps on searching for a physical file.
 
Ok, I'm still struggling with this.
Somebody has any great insights on what I'm missing?

How does a new DA install behave differently compared to before?
 
Anybody smart enough to solve this? :)
Send a private message if you want payment, probably something small and easy, but I just don't see it...
 
I've been struggling for months with this now.
I'm even willing to pay, can nobody help me with this probably easy nginx config fix?
 
Clasje, there is just *so* much you don't tell us.
1) What version of PHP are you using?
2) What CMS are you using?
3) Have you customized your configuration at all--(sounds like yes).
4) Can we have a domain?
5) Did you remember to rewrite your confs & reload Nginx? (it's an easy thing to forget).
6) Have you checked your file permissions?

Have I asked enough questions for now w/o providing anything in the way of concrete answers? Sorry for that, but I failed telepathy 101 miserably.


I have a DA server that is about 3 years old and I'm now doing a clean install on a new server.
Both run on nginx, installed via custombuild.
Custombuild both has the latest versions installed, so the servers should be identical.

On the new DA installation, my nginx customizations however no longer require me to use "fastcgi_pass unix:/usr/local/php56/sockets/xxx.sock;"

However, when I restore the backup from the old server to the new server.
The homepage is working, but all subpages like domain.com/Thread/123-article/ are no longer working and are returning a 404 error.

I tried removing the last part ( location ~ [^/]\.php(/|$) { )
Then I don't get a 404, but still the correct pages won't load.

Do any of you know what changed in directadmin and how the new customization for fastcgi_pass should look like?

#Downloads rewrite ^/database/(.*)/([0-9]+)-(.*)/index.html /filebase/Entry/$2-$3/ permanent; #User profiles rewrite ^/user/([0-9]+)/(.*)/$ /User/$1-$2/ permanent; #Incoming linkpartners rewrite ^/in/(.*)$ / permanent; # Sitemaps plugin location /sitemap.xml { try_files $uri $uri/ /wcf/sitemaps/sitemap.xml; } #if ($request_uri !~ .*index\.php.* ) { if ($request_uri !~ (.*index\.php.*|/acp/js/.*)$ ) { rewrite ^/blog/Entry/(.*)$ /blog/index.php/Entry/$1/ break; rewrite ^/blog/(.*)/$ /blog/index.php/$1/ break; rewrite ^/cms/(.*)/$ /cms/index.php/$1/ break; rewrite ^/filebase/(.*)/$ /filebase/index.php/$1/ break; rewrite ^/Board/(.*)/$ /index.php/Board/$1/ break; rewrite ^/User/(.*)/$ /index.php/User/$1/ break; rewrite ^/Thread/(.*)/$ /index.php/Thread/$1/ break; rewrite ^/Thread/(.*)$ /index.php/Thread/$1/ break; rewrite ^/ThreadAdd/(.*)/$ /index.php/ThreadAdd/$1/ break; rewrite ^/SearchResult/(.*)/$ /index.php/SearchResult/$1 break; rewrite ^/([a-zA-Z]*)/(.*)/$ /index.php/$1/$2/ break; rewrite ^/([a-zA-Z]*)/$ /index.php/$1 break; } #proxy_intercept_errors on; #error_page 404 /cms/Page/; #?alias=404; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_read_timeout 300; fastcgi_pass unix:/usr/local/php56/sockets/ictsnew.sock; fastcgi_index index.php; include fastcgi_params; }

Thank you and happy newyear!
 
maybe nginx build with pcre2 ? it starting since 1.21.5+.

Can you downgrade to something like 1.21.4 and check it.

Somehow nginx have something wrong with Regex Match.
 
Back
Top