Nginx customization not working on new DA installation

klasje

Verified User
Joined
Jan 5, 2008
Messages
42
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!
 

klasje

Verified User
Joined
Jan 5, 2008
Messages
42
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.
 

klasje

Verified User
Joined
Jan 5, 2008
Messages
42
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?
 
Top