I have a Wordpress installation, and in it's root folder I have a custom built external service. This external service I would like to run on a separate pool. So I created 2 pools of php FPM for it one will be running in 127.0.0.1:9000 and the second is in: 127.0.0.1:9001
I checked that I can telnet to this port and that it's open and working.
My NGINX would not send the data in. Here is my nginx configuration:
server {
listen 80;
root /var/www/website;
index index.php index.html index.htm;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location /service {
# include cors;
try_files $uri =404;
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param REMOTE_ADDR $http_cf_connecting_ip;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param REMOTE_ADDR $http_cf_connecting_ip;
}
}
Now when I go to
I am getting 404 of the wordpress, but when I go to
http://localhost/service/index.php
I am getting the service.
If I remove the
location /service
from the Nginx configuration I am getting the index.php in the service folder when I am navigating to http://localhost/service
How do I configure things so the service is called on the /service URL?