Custom configuration
Adnan RIHAN
adnan at rihan.fr
Wed Mar 28 07:48:26 UTC 2012
I'm actually using NGinx as webserver, for a hosting service, with CPanel. CPNginx, the name of the module.
> root at shadow [/etc/cpnginx]# ls
> ./ data.conf localkey.txt uninstall.sh
> ../ direct/ md5.txt version.txt
> cpanelproxy.conf expires/ nginx.cont.template vhost.conf
> custom/ fileextensions.txt php.ini
> root at shadow [/etc/cpnginx]# cat cpanelproxy.conf
> ###### Security ########
> server_tokens off;
>
> ###### To redirect cpanel.yourdomain.com ###########################3
>
> server {
> access_log off;
> error_log logs/vhost-error_log warn;
> listen 80;
> server_name cpanel.* www.cpanel.*;
> location / {
> client_max_body_size 10m;
> client_body_buffer_size 128k;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 4k;
> proxy_buffers 16 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_connect_timeout 30s;
> proxy_redirect http://www.cpanel.*:8888 http://www.cpanel.*;
> proxy_redirect http://cpanel.*:8888 http://cpanel.*;
> proxy_pass http://127.0.0.1:2082/;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
>
> }
> ################# To redirect whm.yourdomain.com #####################
> server {
> access_log off;
> error_log logs/vhost-error_log warn;
> listen 80;
> server_name whm.* www.whm.*;
> location / {
> client_max_body_size 10m;
> client_body_buffer_size 128k;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 4k;
> proxy_buffers 16 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_connect_timeout 30s;
> proxy_redirect http://www.whm.*:8888 http://www.whm.*;
> proxy_redirect http://whm.*:8888 http://whm.*;
> proxy_pass http://127.0.0.1:2086/;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
>
> }
> ######### To redirect webmail.yourdomain.com ##################
> server {
> access_log off;
> error_log logs/vhost-error_log warn;
> listen 80;
> server_name webmail.* www.webmail.*;
> location / {
> client_max_body_size 10m;
> client_body_buffer_size 128k;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 4k;
> proxy_buffers 16 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_connect_timeout 30s;
> proxy_redirect http://www.webmail.*:8888 http://www.webmail.*;
> proxy_redirect http://webmail.*:8888 http://webmail.*;
> proxy_pass http://127.0.0.1:2095/;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
>
> }
> ############# To redirect webdisk.yourdomain.com ##################
> server {
> access_log off;
> error_log logs/vhost-error_log warn;
> listen 80;
> server_name webdisk.* www.webdisk.*;
> location / {
> client_max_body_size 10m;
> client_body_buffer_size 128k;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 4k;
> proxy_buffers 16 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_connect_timeout 30s;
> proxy_redirect http://www.webdisk.*:8888 http://www.webdisk.*;
> proxy_redirect http://webdisk.*:8888 http://webdisk.*;
> proxy_pass http://127.0.0.1:2077/;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
>
> }
> ################### WHM report #################################################
> server {
> error_log logs/vhost-error_log warn;
> listen 80;
> location /whm-server-status {
> access_log /usr/local/apache/logs/access_log;
> proxy_pass http://127.0.0.1:8888/whm-server-status;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
> }
> root at shadow [/etc/cpnginx]# cat nginx.cont.template
> # cPanel Nginx Master configuration
> user nobody;
> error_log logs/error.log;
> #Number of worker you need
> worker_processes 1;
> # How many connections a worker can handle maximum.
> events {
> worker_connections 50000;
> }
> http {
> include mime.types;
> default_type application/octet-stream;
> sendfile on;
> server_names_hash_max_size 10000;
> server_names_hash_bucket_size 1024;
> 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;
> include "/usr/local/nginx/conf/vhost.conf";
> include "/etc/cpnginx/cpanelproxy.conf";
> }
And finally
> root at shadow [/etc/cpnginx]# cat vhost.conf
> client_max_body_size 2000m;
> client_body_buffer_size 512k;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 32k;
> proxy_buffers 16 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_connect_timeout 30s;
In custom, there is only one file, containing the previous posted config.
Thanks for your help.
---
Ragards, Adnan RIHAN.
Président-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), hébergeur Web et Serveurs de Jeux.
Consultant (http://rihan.fr/)-Technicien Supérieur en Informatique de Gestion.
Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)).
Le mercredi 28 mars 2012 à 08:02, Cliff Wells a écrit :
> On Wed, 2012-03-28 at 07:16 +0200, Adnan RIHAN wrote:
> > I've done this:
> >
> > > root at shadow [/etc/cpnginx/custom]# cat mega-sound.be (http://mega-sound.be)
> > > location ~* \.mp3$ {
> > > types {
> > > application/octet-stream mp3;
> > > }
> > > }
> > >
> >
> >
> > But, after rebuilding vhost and restarted nginx, the mp3 are currently
> > audio/mpeg (referring to firefox).
> > Is there a way to check if the config is correctly "set" ?
> >
>
>
> Start by posting more of your configuration.
>
> Cliff
>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org (mailto:nginx at nginx.org)
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120328/e4489e75/attachment-0001.html>
More information about the nginx
mailing list