disable nginx_php.conf; for user in template possible?

knoll

Verified User
Joined
Sep 26, 2005
Messages
140
Location
Belgium
hey,

is it possible to disable
include /usr/local/directadmin/data/users/opelretro/nginx_php.conf;
in the nginx vhost ?

i'm having problems with it
with that included fastcgi cache doesn't work

for all users that i used fastcgi cache on i want to do that
all the things that are in nginx_php are loaded elsewere

but its very strange

when i do this it works when i remove the things here below that are in /usr/local/directadmin/data/users/mydomein/nginx_php.conf
it doesn't work
see config below

just how to disable this for some sites and when rebuild confs are made i don't lose the settings
i know chattr +i could do something but is there an other way?

server
{
listen myip:80;
server_name mydomein.be www.mydomein.be ;
access_log /var/log/nginx/domains/mydomein.be.log;
access_log /var/log/nginx/domains/mydomein.be.bytes bytes;
error_log /var/log/nginx/domains/mydomein.be.error.log;
root /home/opelretro/domains/mydomein.be/public_html;
index index.php index.html index.htm;
# include /usr/local/directadmin/data/users/mydomein/nginx_php.conf;
#fastcgi_cache start
set $no_cache 0;

# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $no_cache 1;
}
if ($query_string != "") {
set $no_cache 1;
}

# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $no_cache 1;
}

# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $no_cache 1;
}

#note location{] block is simple now as caching is done on nginx's end
location / {
try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}

# Pass all .php files onto a php-fpm/php-fcgi server.
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;
include /etc/nginx/nginx_limits.conf;
fastcgi_pass unix:/usr/local/php72/sockets/mydomein.be.sock;

fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
fastcgi_cache WORDPRESS;
#fastcgi_cache_valid 5m;

fastcgi_cache_valid 200 302 60m;
fastcgi_cache_valid 301 1h;
fastcgi_cache_valid any 60m;

fastcgi_hide_header Pragma;
fastcgi_hide_header X-Page-Speed;
fastcgi_hide_header X-Pingback;
fastcgi_hide_header X-Powered-By;
fastcgi_ignore_headers Cache-Control Expires;
}
}
include /etc/nginx/webapps.conf;
}
 
Hello,


Try and add

Code:
|?NGINX_PHP_CONF=|

to CUSTOM section for NGINX for your domain in Directadmin interface at Admin level, httpd customization page it is..
 
many many thanks zEitEr it works
for people reading that don't know where to add
just here on top of httpd config:

here:

Only add the few lines of the server code you need to insert.
Do not add a whole server { ... } entry.

|?NGINX_PHP_CONF=|

--------
and it works thanks grz
 
Back
Top