According to the config, site.com
should open html/web/index.php
by default, however site.com/ticket
should open html/ticket/index.php
. Both ticket
and web
folders located in html
.
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
server_name site.com;
server_tokens off;
root /usr/share/nginx/html/web;
location / {
index index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location /ticket {
root /usr/share/nginx/html/ticket;
index index.php index.html index.htm;
}
}
It opens web/index.php
, however for /ticket
it says Not found
.
UPDATE
The above looks in /usr/share/nginx/html/ticket/ticket/index.php
I tried also
location /ticket {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
and
location /ticket {
alias /usr/share/nginx/html/ticket;
index index.php index.html index.htm;
}
Both configs look in /usr/share/nginx/html/web/ticket/index.php
.
It should look in /usr/share/nginx/html/ticket/index.php
I suppose, problem is in FastCGI
SOLUTION
The problem was in FastCGI configurations
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;