11-02-2009, 10:58 PM | #1 |
Member
Join Date: Oct 2009
Posts: 71
|
Modify / include nginx config
hi,
I'd like to add some stuff to nginx config special for one ore more vhosts. I'm using nginx with the default isp manager setup as a proxy. Is that possible? Where can i add my own stuff without it beeing removed by isp manager later? Thanks for helping. Frank |
11-03-2009, 07:24 AM | #3 |
Member
Join Date: Oct 2009
Posts: 71
|
I am alreay using nginx as a frontend proxy but i'd like to add some own config code to nginx config (or via include).
Is this possible without isp manager having overwrite it? The reason is i'd like to add some rules to fetch special static files from a worpdress+wp-supercache setup. These files are not directly called but have to be found via rules. The have to be added at vhost level - an include would be fine. |
11-03-2009, 08:27 AM | #5 |
Member
Join Date: Oct 2009
Posts: 71
|
so i can just add a line within the server part of a vhost? for example here:
Code:
server { listen 109.123.66.120:80; server_name domain.com; here location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) { proxy_pass http://0.0.0.0:8080; proxy_redirect http://domain.com:8080/ /; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } location / { proxy_pass http://0.0.0.0:8080; proxy_redirect http://domain.com:8080/ /; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ { root /var/www/.../data/www/...; access_log /var/www/httpd-logs/community.heimtechnik.com.access.log; error_page 404 = @fallback; } location @fallback { proxy_pass http://0.0.0.0:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } } |
05-21-2011, 01:05 AM | #7 |
Junior Member
Join Date: Jan 2011
Posts: 20
|
changing the template
what do I do to change the nginx.conf template ispmanager uses?
I have to add expire setting into the server locations. e.g. I have to change the default ispmanager: Code:
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ { root /var/www/user/data/www/test.domain.com; access_log /var/www/httpd-logs/test.domain.com.access.log ; access_log /var/www/nginx-logs/user isp; } Code:
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css)$ { root /var/www/user/data/www/test.domain.com; access_log off; expires 30d; } |
|
|