I am trying to add wordpress as a subdirectory into rails, If I try to access the blog root page without trailing / or adding /index.php I get access denied.
403
/ 200
.php 200
here is my conf:
location /blog {
root /var/www/example/current;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
location ~* \.(?:css|js|map|jpe?g|gif|png)$ { }
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
nginx error log:
Access to the script '/var/www/example/current/blog' has been denied (see security.limit_extensions)" while reading response header from upstream
/etc/php/7.2/fpm/pool.d/www.conf:
security.limit_extensions = .php .php3 .php4 .php5 .php7 .js .css
any idea?
I am trying to add wordpress as a subdirectory into rails, If I try to access the blog root page without trailing / or adding /index.php I get access denied.
https://example/blog 403
https://example/blog/ 200
https://example/blog/index.php 200
here is my conf:
location /blog {
root /var/www/example/current;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
location ~* \.(?:css|js|map|jpe?g|gif|png)$ { }
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
nginx error log:
Access to the script '/var/www/example/current/blog' has been denied (see security.limit_extensions)" while reading response header from upstream
/etc/php/7.2/fpm/pool.d/www.conf:
security.limit_extensions = .php .php3 .php4 .php5 .php7 .js .css
any idea?
Share Improve this question edited Oct 14, 2019 at 1:47 simo asked Oct 14, 2019 at 1:42 simosimo 1316 bronze badges1 Answer
Reset to default 0I found the answer, I am putting it here incase it might be useful for someone:
change: location /blog
into location /blog/