fix / rewrite

This commit is contained in:
root 2022-12-15 15:29:47 +00:00
parent b32337b6c5
commit 9afb1e3742
2 changed files with 8 additions and 7 deletions

BIN
common/.website.conf.swp Normal file

Binary file not shown.

View File

@ -17,7 +17,7 @@ error_log /var/log/nginx/error.log;
# CGI # CGI
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; try_files $uri /$lang$uri /en$uri =404;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include snippets/fastcgi.conf; include snippets/fastcgi.conf;
fastcgi_pass unix:/run/php/php8.0-fpm.sock; fastcgi_pass unix:/run/php/php8.0-fpm.sock;
@ -35,12 +35,13 @@ location ~ (\.cgi|\.py|\.sh|\.pl|\.lua|\/cgi-bin)$ {
# Main # Main
location / { location / {
if ( -d /var/www/website/$lang) { try_files $uri /$lang$uri /en$uri =404;
rewrite .* /$lang$uri; # if ( -d /var/www/website/$lang) {
} # rewrite .* /$lang$uri;
if ( !-d /var/www/website/$lang) { # }
rewrite .* /en$uri; # if ( !-d /var/www/website/$lang) {
} # rewrite .* /en$uri;
# }
} }
error_page 403 /en/errors/403; error_page 403 /en/errors/403;