Welcome! Log In Create A New Profile

Advanced

Re: Custom configuration

All files from this thread

File Name File Size   Posted by Date  
Capture =?utf-8?Q?d=E2=80=99e=CC=81cran_?=2012-03-31 =?utf-8?Q?a=CC=80_?=01.34.16.png 29.2 KB open | download Adnan RIHAN 03/30/2012 Read message
Adnan RIHAN
March 28, 2012 03:50AM
I'm actually using NGinx as webserver, for a hosting service, with CPanel.. CPNginx, the name of the module.

> root@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@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@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@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@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@nginx.org (mailto:nginx@nginx.org)
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Custom configuration

Adnan RIHAN March 27, 2012 05:48PM

Re: Custom configuration

Cliff Wells March 27, 2012 06:16PM

Re: Custom configuration

Adnan RIHAN March 28, 2012 01:18AM

Re: Custom configuration

Cliff Wells March 28, 2012 02:04AM

Re: Custom configuration

Adnan RIHAN March 28, 2012 03:50AM

Re: Custom configuration

Adnan RIHAN March 28, 2012 12:12PM

Re: Custom configuration

Cliff Wells March 28, 2012 01:16PM

Re: Custom configuration

locojohn March 28, 2012 02:31PM

Re: Custom configuration

Adnan RIHAN March 28, 2012 06:52PM

Re: Custom configuration

locojohn March 28, 2012 06:57PM

Re: Custom configuration

Adnan RIHAN March 28, 2012 07:08PM

Re: Custom configuration

locojohn March 28, 2012 07:15PM

Re: Custom configuration

Adnan RIHAN March 28, 2012 07:22PM

Re: Custom configuration

Cliff Wells March 28, 2012 08:16PM

Re: Custom configuration

Adnan RIHAN March 28, 2012 08:38PM

Re: Custom configuration

Adnan RIHAN March 30, 2012 01:10AM

Re: Custom configuration

Adnan RIHAN March 30, 2012 03:12AM

Re: Custom configuration

Francis Daly March 30, 2012 04:38AM

Re: Custom configuration

Adnan RIHAN March 30, 2012 11:46AM

Re: Custom configuration

Francis Daly March 30, 2012 02:16PM

Re: Custom configuration Attachments

Adnan RIHAN March 30, 2012 07:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready