Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Joomla custom app, matching and using alias/try_files

$
0
0
This has been my attempt at it after working for several hours... I keep getting 404 errors when trying to match /catalogue/??????, in this case I'd like it to try root /index.php?args.
I've aliased the root and nested PHP fastcgi_param SCRIPT_FILENAME $request_filename thinking that would be it but I'm afraid there's no change.



server {
listen *:80;
server_name mysite.com ;

root /var/www/mysite.com/web/;

if ($http_host != "mysite.com") {
rewrite ^ $scheme://mysite.com$request_uri? permanent;
}

index index.html index.htm index.php index.cgi index.pl index.xhtml;

location ~ /\. {
deny all;
}

location = /favicon.ico {
log_not_found off;
access_log off;
expires max;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~ \.php$ {
try_files /fb25ca5e73fd29cfa241f5e05cce00f2.htm @php;
}

location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/lib/php5-fpm/web5.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}




location ^/catalogue/(.*)$ {
alias /var/www/mysite.com/web/;
try_files $uri $uri/ /index.php?$args;

location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/lib/php5-fpm/web5.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
}

}

client_max_body_size 200M;
try_files $uri $uri/ /index.php?$args;
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>