US: 1-941-4621-069
  
Cyprus: 3-572-2052-781

Go Back   ISPsystem.com Forums > ISPmanager > General technical discussion


Reply
 
Thread Tools
Old 11-02-2009, 10:58 PM   #1
Member
 
Join Date: Oct 2009
Posts: 71
Helmi is on a distinguished road
Default 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
Helmi is offline   Reply With Quote
Old 11-03-2009, 07:19 AM   #2
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

ISPmanager can work with nginx. It uses nginx as front-end before apache. What system do you have? Nginx can be installed via Features menu.

Last edited by tanya; 11-05-2009 at 06:19 AM.
slava is offline   Reply With Quote
Old 11-03-2009, 07:24 AM   #3
Member
 
Join Date: Oct 2009
Posts: 71
Helmi is on a distinguished road
Default

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.
Helmi is offline   Reply With Quote
Old 11-03-2009, 08:21 AM   #4
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

Yes, you can add lines to nginx config and this include will not be overwritten
slava is offline   Reply With Quote
Old 11-03-2009, 08:27 AM   #5
Member
 
Join Date: Oct 2009
Posts: 71
Helmi is on a distinguished road
Default

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;
                }
        }
or is there a way to place an include file in the conf.d directory and override parts in the server-part of the config?
Helmi is offline   Reply With Quote
Old 11-03-2009, 09:20 AM   #6
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

Add lines where you type "here"
slava is offline   Reply With Quote
Old 05-21-2011, 01:05 AM   #7
Junior Member
 
Join Date: Jan 2011
Posts: 20
krisj is on a distinguished road
Default 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;
		}
to this:

Code:
		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css)$ {
			root /var/www/user/data/www/test.domain.com;
			access_log   off;
			expires      30d;
		}
i would like this to be used as a default on my server, is it possible? or do I have to make my own manual script?
krisj is offline   Reply With Quote
Old 07-26-2012, 12:36 AM   #8
Junior Member
 
Join Date: Jul 2012
Posts: 1
steven99 is on a distinguished road
Default

Did you ever get this figured out? I'm at the same point now as you were.
steven99 is offline   Reply With Quote
Old 07-31-2012, 12:23 PM   #9
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

No, this is did not possible
slava is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:57 PM.