Hi, i have a trouble. I need to add a custom "location" block to one of my domains. I don't want to make a copy of a template, because of i need it only for the certain domain. Also, i need it permanent so, i decided to use this file for: /usr/local/directadmin/data/users/$USER/domains/$DOMAIN.cust_nginx
What i currently have:
What i want it to be:
What i currently have:
Code:
# Auto generated nginx config file by DirectAdmin version 1.50.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website
# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
server
{
listen 78.155.221.251:80;
server_name somedomain.com www.somedomain.com ;
access_log /var/log/nginx/domains/somedomain.com.log;
access_log /var/log/nginx/domains/somedomain.com.bytes bytes;
error_log /var/log/nginx/domains/somedomain.com.error.log;
root /home/someuser/domains/somedomain.com/public_html/current/frontend/web;
index index.php index.html index.htm;
include /usr/local/directadmin/data/users/someuser/nginx_php.conf;
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://78.155.221.251:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias /home/someuser/domains/somedomain.com/public_html/current/frontend/web/;
internal;
}
include /etc/nginx/webapps.conf;
}
What i want it to be:
Code:
# Auto generated nginx config file by DirectAdmin version 1.50.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website
# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
server
{
listen 78.155.221.251:80;
server_name somedomain.com www.somedomain.com ;
access_log /var/log/nginx/domains/somedomain.com.log;
access_log /var/log/nginx/domains/somedomain.com.bytes bytes;
error_log /var/log/nginx/domains/somedomain.com.error.log;
root /home/someuser/domains/somedomain.com/public_html/current/frontend/web;
index index.php index.html index.htm;
include /usr/local/directadmin/data/users/someuser/nginx_php.conf;
location ~* \.(jpg|jpeg|gif|png|swf|tiff|swf|flv)$ {
expires 4M;
add_header Cache-Control public;
}
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://78.155.221.251:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias /home/someuser/domains/somedomain.com/public_html/current/frontend/web/;
internal;
}
include /etc/nginx/webapps.conf;
}
Code:
location ~* \.(jpg|jpeg|gif|png|swf|tiff|swf|flv)$ {
expires 4M;
add_header Cache-Control public;
}