Opened 6 years ago

Last modified 6 years ago

#1574 closed defect

Использование alias и php-fpm — at Initial Version

Reported by: BadWings@… Owned by:
Priority: trivial Milestone:
Component: nginx-module Version: 1.15.x
Keywords: Cc: badwings@…
uname -a: Linux 4.15.0-22-generic #24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.0g 2 Nov 2017
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-mcUg8N/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module

Description

Конфиг

server {

listen 80;
listen [::]:80;

root /var/www/html;
server_name localhost;



location / {

index index.php index.html index.htm;


try_files $uri $uri/ =404;


}

location ~ \/wordpress\/(.*\..*) {

alias /var/www/123/$1;

}




location ~ ((?!(wordpress)).)*\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}



}

Очень странный при этом document_root, равен /var/www/123/$1, а script_name = $uri.

Тогда не проходит проверка, в /snippets/fastcgi-php.conf :
try_files $fastcgi_script_name =404; Очевидно что по реальному uri, файла не будет, для этого и используется alias.

Если же пропустить этот шаг. Тогда неправильно формируется SCRIPT_FILENAME по $document_root$fastcgi_script_name.

alias так и должен работать?

Change History (0)

Note: See TracTickets for help on using tickets.