I have a static site Angular site and I want to have the path /deploy run a php the php script /var/www/app/deploy/deploy.php. I have tried a rewrite rule and having no luck.
What is the proper way to do this?
php.conf
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
}
vhost.conf
server {
listen 80;
server_name app.com;
root /var/www/app/;
include /etc/nginx/default.d/php.conf;
location / {
root /var/www/app/frontend/dist;
try_files $uri $uri/ /index.html =404;
rewrite ^/deploy /var/www/app/deploy/deploy.php;
}
}