Modified template for only one vhost

CISWS

Verified User
Joined
Aug 4, 2016
Messages
8
Hi there,

We have a custom NGINX template in /usr/local/directadmin/data/templates/custom/nginx_php.conf which looks like this:

|*if HAVE_PHP1_FPM="1"|
# use fastcgi for all php files
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ( $skip_cache ~ "^$" ) {
set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache FASTCGICACHE;
fastcgi_cache_valid 60m;
include /etc/nginx/nginx_limits.conf;

if (-f $request_filename)
{
fastcgi_pass unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock;
}
}
location ~ \.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$
{
deny all;
}
|*endif|

location /api {
proxy_pass http://localhost:3000
}

And now we need only one host that must have the last lines like this:
location /api {
proxy_pass http://localhost:3001
}

Where can I configure that?

Thanks in advance,
Roland
 
Just editing via GUI "Custom HTTPD Configuration".

CUSTOM4 token should be the last line of template.
 
Thanks for your answer. Before I posted my question I added

|?PROXY_PASS=http://localhost:3001/|

in the nginx.conf Customization and that seems to do the trick as well. I did NGINX reload to load the configuration but probably that wasn't enough. When I later did a restart of NGINX the rule was applied to the virtual host's configuration.
 
Back
Top