Planing on installing nginx need advice

Planing on installing nginx need advice
My setup is
VPS Cloud 3 blocks of CPUs with 6 Gigs Ram
wp 3.1.3 Multi Site With Domain Mapping Plug in from wpmuDev
Dedicated IP other then servers IP (i hope i explained that correctly)

Do I need to do anything beside installing nginx the one I was going to use is the free on that has the whm control panel http://nginxcp.com/

I was just going to install it but thought about if there was any comparability problems with Multisite installs so I stopped and came here.

I came back to be a little more clearer on my setup

server has main domain
maindomain.com
server name is server.maindomain.com
then the main domain is a reseller with many web site under it
phpbb forums we will call it phpbbinstall1.com phpbbinstall2.com ect.
2 wp single installs we will call it wpinstall1.com wpinstall2.com
1 multisite install (The one I'm speaking about) with its own IP
we will call it multisiteinstall.com
the reason I'm mentioning this is I notice some people posting there nginx configs for wp installs and no one was clear on it you have multiple domains besides word press installs
I saw this so it confused me so when you are writing about how to setup be aware of the multiple domains
this is what I noticed
server_name MYSITE.com;
would it be for me
server_name server.maindomain.com;
I'm so confused (knocking head on table)

  • Philip John

    Hiya!

    I'm afraid I don't have any experience with Nginx so can't offer specific advice but hopefully others will...

    I did have a quick browse around to see what I could find and came up with these you might want to check out:
    http://elasticdog.com/2008/02/howto-install-wordpress-on-nginx/
    http://codex.wordpress.org/Nginx
    http://wordpress.org/extend/plugins/nginx-compatibility/

    Hope that helps!
    Phil

  • Michel Mosca

    Hi n2rga

    Let me say that I am no experienced server admin. It recently installed Nginx on a VPS (1GB Ram, 0.5 CPU) as my first setup and I followed some general recommendations from the forums here. They were

    Debian
    Apache mod_PHP
    APC
    Nginx and
    Memcache
    wildcard subdomains enabled
    MySQL /phpMyAdmin
    For a control panel I chose Webmin/Usermin over CPanel as WHM/cPanel was said to go heavy on ram and I did not need to manage user accounts. I guess your hardware specs allow for more tolerance in this regard.

    For the NGINX install (from source) I learned as I went along and chose to follow the directives from this thread (jump over the first bit about Varnish):

    http://www.myatus.co.uk/2010/06/28/a-simplified-nginx-apache-combo-with-wordpress-support/

    I found the advantage in this over others that I don't need any integrator and caching plugins as all the caching is done server side. (In a first attempt with the integrator plugin I had some troubles getting Buddypress and W3TCache play together nicely - but probably more due to my lack of expertise and patience..).

    It works well and stable for me now and the performace achieved is good enough for my purpose.with PageSpeed 95% Grade A and Yslow 91% Grade A (GTmetrix.com). with just a bit combining CSS and using the wp-minify plugin for JS. I have certainly not maxed out optimization. (there is a limit to my curiosity... :grinning:

    The config files I have assembled from bits and pieces and clues that I got from various sources and am not absolutely sure if they are 'foolproof', but they seem to work so far. Basically all front end stuff is cached and all back end (admin) stuff is not.

    Nginx seems to be a bit of a moving target with functions added, modified and deprecated with every update. So let me just add my comments here as a general direction, without claim for anything in particular. There are certainly more experienced people around here when it comes to the config stuff.
    Hope this helps you in some way. Just keep asking here and use Google for anything that pops up along the way - there is heaps of information out there. Good luck!

    Michel

  • HamRadioDude

    Thank you for that
    The question that brings to mind now I see a lot of Debian / Ubuntu configs would centos5 configs be different?
    The nginxcp people on their forum say just install and it should work out of the box. I guess that's for most normal web sites. we are talking about Hungry Hungry Wordpress now :>

    I keep going for the keyboard to install then stop my self as I will probably regret it when wordpress is not working any more.
    The other thing that bothers me is editing config files while in root I never did it. before this I had a system admin do it for my wifes Web hosting business and I had my personal sites on her server. Now that the web Hosting is no more I'm on my own and I'm forcing myself to learn this.
    Now to find out how to edit files in root
    :>

  • Michel Mosca

    I guess Nginx will run out of the box, but as you assume rightly the question is the configuration requirements for your particular case. So it's certainly not a quick install, as it needs quite a bit of tweaking/configuring.

    you might want to read this thread from the forum here to just get a bit an idea about the level of different opinions and options on the entire matter, plus some insight, why Debian/Ubuntu is preferred over CentOS:

    https://premium.wpmudev.org/forums/topic/yet-another-server-thred

    I would not attempt to install in a live production environment without having a clear idea what you are doing... this is just my opinion. I fear it will be difficult to get it up and running without significant downtimes. And especially as you are hosting a bunch of sites with different requirements...

    My advice would be to either either hire an expert or to move your sites to a server set up with Nginx.

    Not that I want to talk you out of a learning experience - it's actually very valuable to get a grasp of it - but if you want to learn it, then I highly recommend you do so in a sandbox environment like on a small fresh server and gather some experience, before attempting to modify your production server ... (and don't forget to backup everything before attempting anything, so you can always easily fall back onto the present state).

  • HamRadioDude

    Thank you Michel
    I'm reading it now
    Yes it is a production server and I would hire someone but I check one person out and I really don't want to pay $75 per WP install when I have 3 on the server.
    If I can get someone that has the same type of setup I probably can get it running good.
    the wordpress sites being down would not be a lose as the two don't make any money and the one thats my wife's is so new that no one knows its online again yet.(multisite)
    then the forums phpbb would probably be no problem standard php sites the phpLD directory's would be no problem again standard php in in fact the tech on their support form recommended it.

    Just have to find someone with the same type of setup as me

    EDITED: I finished reading through it and a lot of good points were made I guess I will have to use mod_php and not suPHP but cPanel I like
    mod_php was one of the questions I had in my mind so I will do that first. the other question I had was fastcgi how do I check if I have it and if not how to install it? and Do I need it?

  • Ovidiu

    @n2rga:

    honestly, this is server administration and if you need to ask such basic question as how do I check if I have X installed, you're in way over your head. Please don't take offense but you need to be aware you are now a server admin. You need to keep your system updated and make sure verything is running as intended. There is a reason why a certified server admin is earning big bucks. This is not a PC at your office you are playign with, its a publicly reachable server. You are responsible for it. IF it gets infected or hacked and is used in hacking or a DOS attack, you are responsible

    That said, let me add some helpful info too:

    - The link you gave in the beginning: Nginx Admin – cPanel nginx automated installer Plugin - that is only helpful if you run cPanel since its an add-on, do you have cPanel?

    - Yes, things work differently in Centos than they do in Debian.

    - you said:

    server has main domain
    maindomain.com
    server name is server.maindomain.com

    that is not quite possible. I am sure your server name is something like yxjajs.yourvpsprovider.com - it will definitely not have the name of one of your domains.

    - As to your nginx config: for multisite you need a directive like this: server_name _; this is a catch all vhost which is needed for multisite with dub domain install and domain mapping if you want to use that.

    - Any info you need about nginx can be found here: http://wiki.nginx.org

    - why are you looking to use nginx as a proxy for apache? why not use nginx and fastcgi and be done with it?

    ###edit###
    read more of this thread, so here are some mroe points:

    - you say you will be going with mod_Php - do you understand the difference between mod_Php and suPhp and fastCGI?

    - I completely agree with Michel:

    Not that I want to talk you out of a learning experience - it's actually very valuable to get a grasp of it - but if you want to learn it, then I highly recommend you do so in a sandbox environment like on a small fresh server and gather some experience, before attempting to modify your production server ... (and don't forget to backup everything before attempting anything, so you can always easily fall back onto the present state).

  • HamRadioDude

    @Ovidiu
    thanks every little bit helps

    honestly, this is server administration and if you need to ask such basic question as how do I check if I have X installed, you're in way over your head. Please don't take offense but you need to be aware you are now a server admin. You need to keep your system updated and make sure verything is running as intended. There is a reason why a certified server admin is earning big bucks. This is not a PC at your office you are playign with, its a publicly reachable server. You are responsible for it. IF it gets infected or hacked and is used in hacking or a DOS attack, you are responsible
    I do realize it and this is why I'm asking questions and getting feedback. when I wrote about how do I check I didn't realize fastcgi was a php handler.

    stepping down from the witness stand now.

    >only helpful if you run cPanel
    Yes I'm using cpanel v11.30

    >server_name _;
    Noted thanks

    >you say you will be going with mod_Php - do you understand the difference between mod_Php and
    >suPhp and fastCGI?
    Yes

  • Ovidiu

    @n2rga: glad you took my comment with humour.
    so if you're using cPanel, go with that plugin. it seems reasonably good, at least from their sales pitch :slight_smile:

    I still recommend not testing on the live server...
    I think that is all I can contribute, speak up if you have more specific questions.

    ###edit###
    in case you are looking for a quick and easy solution for working with small VPS, I have successfully tested this solution: https://github.com/Xeoncross/lowendscript but beware of these issues: https://github.com/lowendbox/lowendscript/issues?sort=updated&direction=desc&state=open

  • HamRadioDude

    One thing I forgot to mention
    My server name is the same name as my main domain or what in my mind was the main site
    server.mydomainname.com
    and one of the sites mydomainname.com is a wordpress site.

    Should I change the server name and what will it effect if I do?

    EDITED: according to cpanel
    It is important to choose a hostname that you will not be using for any account. You should choose something that will be socially acceptable, as it will appear in all mail headers. Your hostname must be a FQDN. In english, A hostname should consist of a name and a domain name. All valid hostnames should have 2 dots in them. Hostnames should never begin with "www". Hostnames should also not begin with a digit, nor end with a hyphen ("-").
    So what that means to me in my mind was use a real domain name but not a name that you would use for an account like mysite.mydomainname.com
    where mysite. is an account im not using
    Should I use a domain name that I'm no using?
    sever.extradomainimnotusing.com

  • Jonathan

    I called my server mail.mydomainname.com because I installed postfix on it and am sending email from the server (which will eventually host all my domains) - made sense from a email / spam point of view (was recommended) to call it mail. / I don't see anything wrong with yours being called server, unless you want to call it something else?

    I run Nginx (It's so much better than Apache) , you're going to love it :wink:

    Jonathan.

  • Ovidiu

    jepp, I brought that up. wasn't quite clear about it I admit.
    the point is that as you quoted cPanel, you "usually" don't use a domain you want to actively use for anything else.

    so if your VPS didn't come with a default name and domain (I've never encountered one that doesn't) you can certainly use a spare domain. I can't 100% explain this habit but look at it this way: by appointing a name/domain to your server you're basically tying it down to that server while domains, are usually something you can move from one server to another, change providers, etc.
    basically you can use a spare domain, just make sure you don't need it for anything else.

    as for the argument about postfix: since you'll be hosting multiple domains, it doesn't matter what name/domain you're giving your server since postfix will be handling multiple domains anyway...
    just make sure you have your reverse DNS set up properly: http://en.wikipedia.org/wiki/Reverse_dns

  • Jonathan

    @Ovidiu,

    I wasn't disagreeing with you :wink: Just stating I have the same options available to me so there wasn't a concern about naming.

    Yeah, with cloud hosting, in my case vps.net "they" offer you custom names -
    they even list an e.g server1.domain.com when creating a new server - I presume due to the fact that you can have unlimited servers off of one account - things can get really confusing really fast - laugh.
    Especially when you start offloading and creating multiple servers (msql, mail etc)
    I agree 100% about the reverse dns - I did that already, had to request it via a support ticket (only thing you don't have control over at vps.net), took a day to do, but worth it and recommend the same to everyone :wink:

    Jonathan

  • HamRadioDude

    Man i have been busy the last few days.
    installed the free nginx with cPanel plugin Built in had a few errors posted about it on their forum got no answer searched the internet. Did not find one person talking about or saying they used it let alone how to fix the error.
    Found answer on one error, then they finally posted about it on their forum and said I should search the forum it was discussed many times. Then I spoke up about it and every question after that was ignored.In fact they still have not answered one of my questions. My advice they have a lot of posts having to do with nginx config they they don't answer and let it go. only ones they address is their plugin for cpanel. Uninstalled. Went to the paid version of nginx ($5 a month one) installed everything looked great asked in forum about rewrites and were told to put them into a fold that would include the domain rules I was very confused got no answer in their forum, put in a support ticket was answered basically said to add them to an include file and put it into a include folder. Wrote them back and if they can help me with the rewrite rules. they said that they would not answer because its I had custom work. I said its not custom it rewrite rules then they gave me 3 lines and turned out that one line server _; you can't include it that file found that out after looking at the error log. They wouldn't help with rewrites I guess same thing they concentrate on their plug in not Nginx.
    Uninstalled started looking for a Nginx guru. said to my self This is not kicking my you know what. so I I installed the regular Nginx from Nginx.com, Works great. But I do need to get the rewrite rules for Wordpress so I'm now looking here for a set that I can use for my situation My next post under this I will post what I have so far. I would apreciate anyone that can help me with them and look at my config. and tell me if what I have is good.
    Bear in mind I have no idea what I'm doing LoL. No really I don't :>

  • HamRadioDude

    Here is my setup
    Cloud VPS with 6 Gigs ram 3 CPU's (Blocks) 80 gigs space
    Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 TimmiT HTTPD Server powered by Apache mod_fcgid/2.3.6
    php 5
    The list of sites are
    http://www.thejokeforum.com - phpBB
    http://www.sampsonforum.com - phpBB
    http://www.stargatestyles.com - phpBB

    http://bloginsphere.com - Wordpress 3.2 Multi Site - New no users yet - WP-Super Cache plugin installed
    http://www.thearcadestation.com - Wordpress 3.2 Single Site
    http://www.stargateportal.info - Wordpress 3.2 Single Site
    http://www.phpbbmodinstalls.com - Wordpress 3.2 Single Site
    http://nli.arrl.org - Wordpress 3.2 Single Site this is a sub domain nli.phpbbmodinstalls.com and arrl.org is pointing a subdomain to it for nli.arrl.org result

    http://www.urllistingdirectory.com - phpLD Link Directory
    http://www.websitelistingdirectory.com - phpLD Link Directory
    http://www.arcadedirectory.net - phpLD Link Directory
    http://www.phpbbdirectory.net - phpLD Link Directory
    http://www.hamradiostop.com - phpLD Link Directory
    http://www.viralvideopalace.com/ - phpLD Video Directory

    http://www.3aliens.net- has a wordpress site but its a test site
    http://www.3aliens.org has the same site as bloginsphere for test and backup (JUSTIN CASE) :>

    nginx.conf

    user  nobody;
    # no need for more workers in the proxy mode
    worker_processes  1;
    
    error_log  logs/error.log info;
    
    worker_rlimit_nofile  8192;
    
    events {
     worker_connections  512; # you might need to increase this setting for busy servers
     use epoll; #  Linux kernels 2.4.x  change to rtsig
    }
    
    http {
     server_names_hash_max_size 2048;
    
     include    mime.types;
     default_type  application/octet-stream;
    
     sendfile on;
     tcp_nopush on;
     tcp_nodelay on;
    
     keepalive_timeout  10;
    
     gzip on;
     gzip_min_length  1100;
     gzip_buffers  4 32k;
     gzip_types    text/plain application/x-javascript text/xml text/css;
     ignore_invalid_headers on;
    
     client_header_timeout  3m;
     client_body_timeout 3m;
     send_timeout     3m;
     connection_pool_size  256;
     client_header_buffer_size 4k;
     large_client_header_buffers 4 32k;
     request_pool_size  4k;
     output_buffers   4 32k;
     postpone_output  1460;
    
     include "/usr/local/nginx/conf/vhost.conf";
    }

    The vhost.conf is one file.
    Can I separate the domains with for example one file for each doamin
    domain.com
    domain1.com
    domain2.com
    domain3.com
    Make a directory and put them all in like the example on codex.wordpress?
    include sites-enabled/*;
    Is there anything else I would need to do to achieve this?

    vhost.conf

    server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  3aliens.net http://www.3aliens.net;
      # The line above is a add on Domain (Mapped) to n2rga.bloginsphere.com
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/aliens/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.3aliens.net:81   http://www.3aliens.net;
       proxy_redirect  http://3aliens.net:81   http://3aliens.net;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
       # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
       #
       location ~ \.php$ {
       fastcgi_pass 127.0.0.1:9000;
       fastcgi_index index.php;
       }
    
       # deny access to .htaccess files.
       #
       location ~ /\.ht {
       deny all;
       }
      }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  3aliens.org http://www.3aliens.org;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/aliensor/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.3aliens.org:81   http://www.3aliens.org;
       proxy_redirect  http://3aliens.org:81   http://3aliens.org;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  arcadedirectory.net http://www.arcadedirectory.net;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/arcadedi/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.arcadedirectory.net:81   http://www.arcadedirectory.net;
       proxy_redirect  http://arcadedirectory.net:81   http://arcadedirectory.net;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  .bloginsphere.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/bloginsp/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.bloginsphere.com:81   http://www.bloginsphere.com;
       proxy_redirect  http://bloginsphere.com:81   http://bloginsphere.com;
    
       proxy_pass   http://216.120.248.206:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  n2rga.com http://www.n2rga.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/bloginsp/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.n2rga.com:81   http://www.n2rga.com;
       proxy_redirect  http://n2rga.com:81   http://n2rga.com;
    
       proxy_pass   http://216.120.248.206:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  hamradiostop.com http://www.hamradiostop.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/hamradio/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.hamradiostop.com:81   http://www.hamradiostop.com;
       proxy_redirect  http://hamradiostop.com:81   http://hamradiostop.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  hamrepeaterdirectory.com http://www.hamrepeaterdirectory.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/hamrepea/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.hamrepeaterdirectory.com:81   http://www.hamrepeaterdirectory.com;
       proxy_redirect  http://hamrepeaterdirectory.com:81   http://hamrepeaterdirectory.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  phpbbdirectory.net http://www.phpbbdirectory.net;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/phpbbdir/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.phpbbdirectory.net:81   http://www.phpbbdirectory.net;
       proxy_redirect  http://phpbbdirectory.net:81   http://phpbbdirectory.net;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  phpbbmodinstalls.com http://www.phpbbmodinstalls.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/phpbbmod/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.phpbbmodinstalls.com:81   http://www.phpbbmodinstalls.com;
       proxy_redirect  http://phpbbmodinstalls.com:81   http://phpbbmodinstalls.com;
    
       proxy_pass   http://216.120.248.226:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  nli.phpbbmodinstalls.com http://www.nli.phpbbmodinstalls.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/phpbbmod/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.nli.phpbbmodinstalls.com:81   http://www.nli.phpbbmodinstalls.com;
       proxy_redirect  http://nli.phpbbmodinstalls.com:81   http://nli.phpbbmodinstalls.com;
    
       proxy_pass   http://216.120.248.226:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  nli.arrl.org http://www.nli.arrl.org;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/phpbbmod/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.nli.arrl.org:81   http://www.nli.arrl.org;
       proxy_redirect  http://nli.arrl.org:81   http://nli.arrl.org;
    
       proxy_pass   http://216.120.248.226:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  sampsonforum.com http://www.sampsonforum.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/sampsonf/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.sampsonforum.com:81   http://www.sampsonforum.com;
       proxy_redirect  http://sampsonforum.com:81   http://sampsonforum.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  stargatestyles.com http://www.stargatestyles.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/sgstyles/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.stargatestyles.com:81   http://www.stargatestyles.com;
       proxy_redirect  http://stargatestyles.com:81   http://stargatestyles.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  stargateportal.info http://www.stargateportal.info;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/stargate/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.stargateportal.info:81   http://www.stargateportal.info;
       proxy_redirect  http://stargateportal.info:81   http://stargateportal.info;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  thearcadestation.com http://www.thearcadestation.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/thearcad/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.thearcadestation.com:81   http://www.thearcadestation.com;
       proxy_redirect  http://thearcadestation.com:81   http://thearcadestation.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  thejokeforum.com http://www.thejokeforum.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/thejokef/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.thejokeforum.com:81   http://www.thejokeforum.com;
       proxy_redirect  http://thejokeforum.com:81   http://thejokeforum.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  urllistingdirectory.com http://www.urllistingdirectory.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/urllisti/public_html;
       }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.urllistingdirectory.com:81   http://www.urllistingdirectory.com;
       proxy_redirect  http://urllistingdirectory.com:81   http://urllistingdirectory.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  viralvideopalace.com http://www.viralvideopalace.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/viralvid/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.viralvideopalace.com:81   http://www.viralvideopalace.com;
       proxy_redirect  http://viralvideopalace.com:81   http://viralvideopalace.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }
       server {
      access_log off;
    
      error_log  logs/vhost-error_log warn;
      listen    80;
      server_name  websitelistingdirectory.com http://www.websitelistingdirectory.com;
    
      # uncomment location below to make nginx serve static files instead of Apache
      # NOTE this will cause issues with bandwidth accounting as files wont be logged
      location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
       root   /home/websitel/public_html;
      }
    
      location / {
       proxy_send_timeout   90;
       proxy_read_timeout   90;
    
       proxy_buffer_size    4k;
       # you can increase proxy_buffers here to suppress "an upstream response
       #  is buffered to a temporary file" warning
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
    
       proxy_connect_timeout 30s;
    
       proxy_redirect  http://www.websitelistingdirectory.com:81   http://www.websitelistingdirectory.com;
       proxy_redirect  http://websitelistingdirectory.com:81   http://websitelistingdirectory.com;
    
       proxy_pass   http://216.120.248.225:81/;
    
       proxy_set_header   Host   $host;
       proxy_set_header   X-Real-IP  $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      }
     }

    fastcgi.conf

    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;

    fastcgi_params

    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;
  • Ovidiu

    firts of all, lets clarify a few things:

    nginx is a free script.

    there is a free cpanel plugin you mentioned and then I heard there is a paid cpanel plugin out there as well. nginx is still free! you might be paying for a plugin to integrate with cpanel, but nginx is free.

    no to your vhost:

    are you wanting to use nginx exclusively now? not as a proxy in front of apache anymore?
    I suggest you split your configs into one file for each vhost but basically all you need for wordpress basic rewrites is line 5-7

    this is one of my vhosts:

    server {
        server_name _yourdomain.tld;
        root /var/www/yourdomain.tld;
        include /etc/nginx/php.conf;
    location / {
       try_files $uri $uri/ /index.php?q=$uri&$args;
    }
    # use fastcgi for all php files
    location ~ \.php$
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    # catch all
        error_page 404 /index.php;
    # deny access to apache .htaccess files
        location ~ /\.ht
    {
            deny all;
    }
    }

    ###edit###
    did I mention nginx is free?

  • HamRadioDude

    Yes nginx is free. I do understand that I didn't say it was paid for. the pay version is for the free nginx and cpanel add on.
    I would like to run nginx as a proxy in front of Apache.
    When I split them up to seprate files I do it the way I mentions with the line I mentioned like this
    domain.com
    domain1.com
    domain2.com
    domain3.com
    Make a directory and put them all in like the example on codex.wordpress?
    include sites-enabled/*;

    Thanks for the help

  • HamRadioDude

    This is the template for the startup config file nginx.conf
    I removed the vhosts include at the end and added a include to load everything in the mysites directory. That is if it works that way?

    user  nobody;
    # no need for more workers in the proxy mode
    worker_processes  1;
    
    error_log  logs/error.log info;
    
    worker_rlimit_nofile  8192;
    
    events {
     worker_connections  512; # you might need to increase this setting for busy servers
     use epoll; #  Linux kernels 2.4.x  change to rtsig
    }
    
    http {
     server_names_hash_max_size 2048;
     index    index.html index.htm index.php;
    
     include    mime.types;
     default_type  application/octet-stream;
     log_format   main '$remote_addr - $remote_user [$time_local]  $status '
        '"$request" $body_bytes_sent "$http_referer" '
        '"$http_user_agent" "$http_x_forwarded_for"';
     access_log   logs/access.log  main;
     sendfile on;
     tcp_nopush on;
     tcp_nodelay on;
    
     keepalive_timeout  10;
    
     gzip on;
     gzip_min_length  1100;
     gzip_buffers  4 32k;
     gzip_types    text/plain application/x-javascript text/xml text/css;
     ignore_invalid_headers on;
    
     client_header_timeout  3m;
     client_body_timeout 3m;
     send_timeout     3m;
     connection_pool_size  256;
     client_header_buffer_size 4k;
     large_client_header_buffers 4 32k;
     request_pool_size  4k;
     output_buffers   4 32k;
     postpone_output  1460;
     # include "/usr/local/nginx/conf/vhost.conf";
     include mysites/*;
    }

    This is the template for a non Wordpress Site

    server {
              error_log  /usr/local/nginx/logs/DOMAINNAME-error_log warn;
              listen 80;
              server_name  .3aliens.net;
              root   /home/DOMAINNAME/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }

    Working on the wordpress one now

  • HamRadioDude

    I'm getting a 502 Bad Gateway with the load of all the files in a directory so I switched all the domain into one vhosts same problem so its not the loading of all the vhost files there one now.

    I will probably start a new thread in and hour or two if I can't find it.
    unless some one can help going top post my current files nginx -t says configuration is good.

    here's the nginx.conf

    user  nobody;
    # no need for more workers in the proxy mode
    worker_processes  1;
    
    error_log  logs/error.log info;
    
    worker_rlimit_nofile  8192;
    
    events {
     worker_connections  512; # you might need to increase this setting for busy servers
     use epoll; #  Linux kernels 2.4.x  change to rtsig
    }
    
    http {
     server_names_hash_max_size 2048;
     index    index.html index.htm index.php;
    
     include    mime.types;
     default_type  application/octet-stream;
     log_format   main '$remote_addr - $remote_user [$time_local]  $status '
        '"$request" $body_bytes_sent "$http_referer" '
        '"$http_user_agent" "$http_x_forwarded_for"';
     access_log   logs/access.log  main;
     sendfile on;
     tcp_nopush on;
     tcp_nodelay on;
    
     keepalive_timeout  10;
    
     gzip on;
     gzip_min_length  1100;
     gzip_buffers  4 32k;
     gzip_types    text/plain application/x-javascript text/xml text/css;
     ignore_invalid_headers on;
    
     client_header_timeout  3m;
     client_body_timeout 3m;
     send_timeout     3m;
     connection_pool_size  256;
     client_header_buffer_size 4k;
     large_client_header_buffers 4 32k;
     request_pool_size  4k;
     output_buffers   4 32k;
     postpone_output  1460;
    include "/usr/local/nginx/conf/vhost.conf";
     # include /usr/local/nginx/mysites/*;
    }

    heres the vhost file

    server {
              error_log  /usr/local/nginx/logs/aliensorg-error_log warn;
              listen 80;
              server_name  .3aliens.org;
              root   /home/aliensorg/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/3aliensnet-error_log warn;
              listen 80;
              server_name  .3aliens.net;
              root   /home/aliens/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/arcadedi-error_log warn;
              listen 80;
              server_name  .arcadedirectory.net;
              root   /home/arcadedi/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/bloginsp-error_log warn;
              listen 80;
              server_name  .bloginsphere.com;
              root   /home/bloginsp/public_html;
    
              location / {
              try_files $uri $uri/ /index.php?$args;
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/hamradio-error_log warn;
              listen 80;
              server_name  .hamradiostop.com;
              root   /home/hamradio/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/hamrepea-error_log warn;
              listen 80;
              server_name  .hamrepeaterdirectory.com;
              root   /home/hamrepea/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/phpbbdir-error_log warn;
              listen 80;
              server_name  .phpbbdirectory.net;
              root   /home/phpbbdir/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/phpbbmod-error_log warn;
              listen 80;
              server_name  .phpbbmodinstalls.com;
              root   /home/phpbbmod/public_html;
    
              location / {
              try_files $uri $uri/ /index.php?$args;
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/stargate-error_log warn;
              listen 80;
              server_name  .stargateportal.info;
              root   /home/stargate/public_html;
    
              location / {
              try_files $uri $uri/ /index.php?$args;
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/sgstyles-error_log warn;
              listen 80;
              server_name  .stargatestyles.com;
              root   /home/sgstyles/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/thearcad-error_log warn;
              listen 80;
              server_name  .thearcadestation.com;
              root   /home/thearcad/public_html;
    
              location / {
              try_files $uri $uri/ /index.php?$args;
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/thejokef-error_log warn;
              listen 80;
              server_name  .thejokeforum.com;
              root   /home/thejokef/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/urllisti-error_log warn;
              listen 80;
              server_name  .urllistingdirectory.com;
              root   /home/urllisti/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/viralvid-error_log warn;
              listen 80;
              server_name  .viralvideopalace.com;
              root   /home/viralvid/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }
      server {
              error_log  /usr/local/nginx/logs/websitel-error_log warn;
              listen 80;
              server_name  .websitelistingdirectory.com;
              root   /home/websitel/public_html;
    
              location / {
              # Rewrite rules can go here
              }
              # serve static files directly
              location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires 7d;
              }
              location ~ \.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass   127.0.0.1:9000;
              }
              location = /favicon.ico { access_log off; log_not_found off;
              }
              location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
              }
              location ~ /\.ht {
              deny all;
         }
      }

    I used the old vhosts with the new nginx.cof file and server back up
    Does anyone see a problem why I'm getting a 502 Bad Gateway error?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.