anyone try this nginx automatic plugin?

I am going to install nginx as a front end over apache. This free plugin is supposed to work. I wanted to ask first if anyone has tried it. If I install the plugin, will the instructions in the Dolphin for nginx setup in the forum still work?

http://nginxcp.com/

Quote · 27 Apr 2014

Alright I'm going to be the tester on this. I will get back in a few days to tell you whether or not it works. Hopefully it does.

Quote · 27 Apr 2014

If it was me, I would switch off Apache.  I have heard that Apache 2.4.9 is suppose to be significantly faster than 2.2.x.  Still, I am an Nginx camper so I may be biased.  Talk to DolphinJay about WHM/cPanel and Nginx as he has experience there and can help you.

Geeks, making the world a better place
Quote · 27 Apr 2014

However, I have read that some things are not compatible with the latest Apache; I think there are issues with perl; best to read up before moving there.  Again I am an Nginx camper so I don't use Apache.

Geeks, making the world a better place
Quote · 27 Apr 2014

Ok now I'm scared. I am going to deploy another cloud and install cpanel all over again. Configuration for me is a pain. But I want my customers to be happy.

Quote · 27 Apr 2014

 

Ok now I'm scared. I am going to deploy another cloud and install cpanel all over again. Configuration for me is a pain. But I want my customers to be happy.

Talk to DolphinJay, he has Nginx running on WHM/cPanel with a WHM/cPanel plugin.  He can help guide you on this.

Geeks, making the world a better place
Quote · 27 Apr 2014

Also, as you work through things, make notes in a text editor.  I have streamlined setting up a new server with all the bits and pieces and have them stored in a text file.  I can do a lot of copy and pasting into my shell so I don't have to type everything out.  Cuts down on typing errors when entering things.

Geeks, making the world a better place
Quote · 27 Apr 2014

this nginx plugin is working fine but what should I set these values to in whm? I need the maximum for streaming and video. I need it to handle 1 gb uploads

 

user  nobody;

# no need for more workers in the proxy mode

worker_processes  2;

error_log  /var/log/nginx/error.log info;

worker_rlimit_nofile 20480;

events {

 worker_connections 5120; # increase for busier servers

 use epoll; # you should use epoll here for Linux kernels 2.6.x

}

http {

 server_name_in_redirect off;

 server_names_hash_max_size 10240;

 server_names_hash_bucket_size 1024;

 include    mime.types;

 default_type  application/octet-stream;

 server_tokens off;

# remove/commentout disable_symlinks if_not_owner;if you get Permission denied error

# disable_symlinks if_not_owner;

 sendfile on;

 tcp_nopush on;

 tcp_nodelay on;

 keepalive_timeout  5;

 gzip on;

 gzip_vary on;

 gzip_disable "MSIE [1-6]\.";

 gzip_proxied any;

 gzip_http_version 1.1;

 gzip_min_length  1000;

 gzip_comp_level  6;

 gzip_buffers  16 8k;

# You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU

 gzip_types    text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/javascript application/xml+rss text/javascript application/atom+xml;

 ignore_invalid_headers on;

 client_header_timeout  3m;

 client_body_timeout 3m;

 send_timeout     3m;

 reset_timedout_connection on;

 connection_pool_size  256;

 client_header_buffer_size 256k;

 large_client_header_buffers 4 256k;

 client_max_body_size 200M; 

 client_body_buffer_size 128k;

 request_pool_size  32k;

 output_buffers   4 32k;

 postpone_output  1460;

 proxy_temp_path  /tmp/nginx_proxy/;

 proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:5m max_size=1000m;

 client_body_in_file_only on;

 log_format bytes_log "$msec $bytes_sent .";

 log_format custom_microcache '$remote_addr - $remote_user [$time_local] '

        '"$request" $status $body_bytes_sent '

        '"$http_referer" "$http_user_agent" nocache:$no_cache';

include "/etc/nginx/vhosts/*";

}

Quote · 2 May 2014

client_max_body_size 200M;

This would need to be increased to the size you are expecting for uploads.  You also have to increase the max uploads in the php.ini settings to match what you expect to be uploading.  Are you running php-fpm?  If so, then after you make changes in the php.ini setting you have to restart php-fpm and if you are using php-fpm, check the settings in the pool as well.

Geeks, making the world a better place
Quote · 2 May 2014

include "/etc/nginx/vhosts/*";

You can set up sites enabled and sites available and use symbolic links; the idea is to make it easy to turn off a server block; the correct term in nginx is server block and not vhost.

However, you can also change that include to /*.conf instead of just *.  Then you don't have to fool with symbolic links and just change the .conf to .conf.off or whatever you want to use and restart nginx to turn off a site; to prevent the server block from being loaded.

Geeks, making the world a better place
Quote · 2 May 2014

so that line should look like this:

/etc/nginx/vhosts/*.conf

or this:

/etc/nginx/serverblock/*.conf

I am using a cloud server.

Does this make it so when I want to change something, I can just edit the .conf file? I have no idea. This is how the manufacturer set it up upon install. I decided to have them install it so I don't mess up my live site.

Quote · 3 May 2014

 

so that line should look like this:

/etc/nginx/vhosts/*.conf

or this:

/etc/nginx/serverblock/*.conf

I am using a cloud server.

Does this make it so when I want to change something, I can just edit the .conf file? I have no idea. This is how the manufacturer set it up upon install. I decided to have them install it so I don't mess up my live site.

How you set it up is how you prefer it.  I mention the term "server block" because that is what Nginx uses and so that is what you need to put in for searches although you probably will see someone calling them vhosts as well.

You can continue to use the same path as they installed it and not worry about it; I would just leave it as is as far as the path.

As for the server blocks, they can all be inside of the Nginx or each one can be a separate file that is included.  The Nginx conf file that you posted is loading in external server blocks; the last line include "/etc/nginx/vhosts/*"; although I don't enclose the path in double quotes; I might look that up and see if Nginx reads the path differently or what the purpose of using the double quotes if any.  With that include, any file in vhost will be included; of course if it is something that should not be included Nginx will complain and not start.

What I was saying is that instead of just loading everything in the directory, you can specify that only certain files get included by changing it to *.conf.  Using that, Nginx will skip any file that does not end in *.conf.  Let's say you have three website, site1, site2, site3.  You can set up a server block for each one of them, site1.conf, site2.conf, and site3.conf.  Nginx will load each of those server blocks into nginx.conf.  Let's say you want to turn one of the site off, site2.  You can rename site2.conf to site2.conf.off and restart Nginx and site2's server block will not be included and not available.  By the way, the way Nginx works is that it will go down the list looking for matches to the HTTP request.  You should set up a server block for your IP address, otherwise it will default to the first server block and that might not be the website you want to load; you can also include the ip address along with the domain name in the particular server block that you would want someone typing in your ip address to be sent to.

Let's say you want to temporary redirect a site to a landing page with a message.  "We are away on holiday and will return on May 28."  Create a server block, site2.holiday.conf.off that directs Nginx to the holiday message site.  You are probably set up on something like /var/www/html; that is where you load your different sites.  So you would just create a directory there, site2_holiday and put in the HTML files needed for your message.  Then just before leaving on holiday, turn off site2.conf (site2.conf.off) and turn on site2.holiday.conf by remove the .off, restart Nginx, and go enjoy the seaside.

 

Did they set up the Nginx init?  if so, then you can issue commands such as service nginx configtest to test a configuration for errors without restarting nginx.  If not, then I would add it, I have an init script you can use, you would have to adjust it for your particular paths as mine are different.  Makes it a bit easier for checking the configuration; try to restart nginx with a bad conf and nginx might not start taking the sites offline, I always check a new server block first.

 

I think you mention that you are using WHM/cPanel with the nginx plugin, so things might be different for you; I run things directly for the most part, I do have webmin install for making things a bit quicker.  I hate working with vi or nano.

Geeks, making the world a better place
Quote · 3 May 2014

Thanks for the info. I think I am going to wait to change anything though. 

Quote · 3 May 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.