Assumption:
Application is running on https://example.com [which is static serving from /home/centos/projects/dist.example.com]
I am trying to run https://example.com/blogs to serve wordpress blog application.
Below is my nginx config
server {
server_name example.com;
root /home/centos/projects/dist.example.com;
index index.html;
access_log /home/centos/log/example/access.log;
error_log /home/centos/log/example/error.log;
location / {
try_files $uri /index.html;
expires -1;
add_header Cache-Control public;
}
location /download {
proxy_pass http://127.0.0.1:7000/api/downloads/;
}
location /blogs {
try_files $uri $uri/ /blogs/index.php?q=$uri&$args;
location ~ \.php$ {
try_files $uri /index.php = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
location ~ /\.ht {
deny all;
}
##
# `gzip` Settings
#
#
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/javascript
text/x-component;
}
I am running my nginx as root and centos linux set on permissive mode. I am successfully able to run the example.com but when i try to run example.com/blogs it gives nginx error 403 forbideed
below is the part of my php-fpm conf
user = centos
; RPM: Keep a group allowed to write in log dir.
group = centos
;listen = 127.0.0.1:9000
listen = /var/run/php-fpm.sock
listen.owner = root
listen.group = root
;listen.mode = 0660
I am not getting where i am facing issue with permission
/home/centos/projects/dist.example.com/blog??