0
server {
listen <...:...>;
server_name <...>;
root /var/www/html/myserver;
location /myproject {
try_files $uri /myproject/web/app.php$is_args$args;
}
location ~ ^/myproject/web/(app_dev|config)\.php(/|$) {
fastcgi_pass <...php-fpm...>;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ ^/myproject/web/app\.php(/|$) {
fastcgi_pass <...php-fpm...>;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
}
내가 myserver.com/myproject/web
Nginx의 심포니 하위 디렉토리 구성
내가 myserver.com/myproject
에서 내 프로젝트에 대한 액세스를 원하는 이동하려고 할 때 내 프로젝트를 볼 수 있습니다.
rewrite ^/myproject(/|$)$ /myproject/web last;