<div>I'm actually using NGinx as webserver, for a hosting service, with CPanel. CPNginx, the name of the module.</div><div><br></div><div><div></div><blockquote type="cite"><div>root@shadow [/etc/cpnginx]# ls</div><div>./                data.conf           localkey.txt         uninstall.sh</div><div>../               direct/             md5.txt              version.txt</div><div>cpanelproxy.conf  expires/            nginx.cont.template  vhost.conf</div><div>custom/           fileextensions.txt  php.ini</div></blockquote><div></div><blockquote type="cite"><div>root@shadow [/etc/cpnginx]# cat cpanelproxy.conf </div><div>###### Security ########</div><div>server_tokens  off; </div><div><br></div><div>###### To redirect cpanel.yourdomain.com ###########################3</div><div><br></div><div>server {</div><div>access_log off;</div><div>error_log  logs/vhost-error_log warn;</div><div>listen    80;</div><div>server_name  cpanel.* www.cpanel.*;</div><div>location / {</div><div>        client_max_body_size    10m;</div><div>        client_body_buffer_size 128k;</div><div>        proxy_send_timeout   90;</div><div>        proxy_read_timeout   90;</div><div>        proxy_buffer_size    4k;</div><div>        proxy_buffers     16 32k;</div><div>        proxy_busy_buffers_size 64k;</div><div>        proxy_temp_file_write_size 64k;</div><div>        proxy_connect_timeout 30s;</div><div>        proxy_redirect  http://www.cpanel.*:8888   http://www.cpanel.*;</div><div>        proxy_redirect  http://cpanel.*:8888   http://cpanel.*;</div><div>        proxy_pass   http://127.0.0.1:2082/;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div><br></div><div>}</div><div>################# To redirect whm.yourdomain.com #####################</div><div>server {</div><div>access_log off;</div><div>error_log  logs/vhost-error_log warn;</div><div>listen    80;</div><div>server_name  whm.* www.whm.*;</div><div>location / {</div><div>        client_max_body_size    10m;</div><div>        client_body_buffer_size 128k;</div><div>        proxy_send_timeout   90;</div><div>        proxy_read_timeout   90;</div><div>        proxy_buffer_size    4k;</div><div>        proxy_buffers     16 32k;</div><div>        proxy_busy_buffers_size 64k;</div><div>        proxy_temp_file_write_size 64k;</div><div>        proxy_connect_timeout 30s;</div><div>        proxy_redirect  http://www.whm.*:8888   http://www.whm.*;</div><div>        proxy_redirect  http://whm.*:8888   http://whm.*;</div><div>        proxy_pass   http://127.0.0.1:2086/;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div><br></div><div>}</div><div>######### To redirect  webmail.yourdomain.com ##################</div><div>server {</div><div>access_log off;</div><div>error_log  logs/vhost-error_log warn;</div><div>listen    80;</div><div>server_name  webmail.* www.webmail.*;</div><div>location / {</div><div>        client_max_body_size    10m;</div><div>        client_body_buffer_size 128k;</div><div>        proxy_send_timeout   90;</div><div>        proxy_read_timeout   90;</div><div>        proxy_buffer_size    4k;</div><div>        proxy_buffers     16 32k;</div><div>        proxy_busy_buffers_size 64k;</div><div>        proxy_temp_file_write_size 64k;</div><div>        proxy_connect_timeout 30s;</div><div>        proxy_redirect  http://www.webmail.*:8888   http://www.webmail.*;</div><div>        proxy_redirect  http://webmail.*:8888   http://webmail.*;</div><div>        proxy_pass   http://127.0.0.1:2095/;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div><br></div><div>}</div><div>############# To redirect webdisk.yourdomain.com ##################</div><div>server {</div><div>access_log off;</div><div>error_log  logs/vhost-error_log warn;</div><div>listen    80;</div><div>server_name  webdisk.* www.webdisk.*;</div><div>location / {</div><div>        client_max_body_size    10m;</div><div>        client_body_buffer_size 128k;</div><div>        proxy_send_timeout   90;</div><div>        proxy_read_timeout   90;</div><div>        proxy_buffer_size    4k;</div><div>        proxy_buffers     16 32k;</div><div>        proxy_busy_buffers_size 64k;</div><div>        proxy_temp_file_write_size 64k;</div><div>        proxy_connect_timeout 30s;</div><div>        proxy_redirect  http://www.webdisk.*:8888   http://www.webdisk.*;</div><div>        proxy_redirect  http://webdisk.*:8888   http://webdisk.*;</div><div>        proxy_pass   http://127.0.0.1:2077/;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div><br></div><div>}</div><div>################### WHM report #################################################</div><div>server {</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>error_log  logs/vhost-error_log warn;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>listen    80;</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>location /whm-server-status {</div><div>                access_log /usr/local/apache/logs/access_log;</div><div>                proxy_pass http://127.0.0.1:8888/whm-server-status;</div><div>                proxy_set_header   Host   $host;</div><div>                proxy_set_header   X-Real-IP  $remote_addr;</div><div>                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>}</div><div>} </div></blockquote><div></div><div></div></div>
                <div><div><div></div><blockquote type="cite"><div>root@shadow [/etc/cpnginx]# cat nginx.cont.template </div><div># cPanel Nginx Master configuration</div><div>user  nobody;</div><div>error_log  logs/error.log;</div><div>#Number of worker you need</div><div>worker_processes  1;</div><div># How many connections a worker can handle maximum.</div><div>events {</div><div>    worker_connections  50000;</div><div>}</div><div>http {</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>include    mime.types;</div><div> <span class="Apple-tab-span" style="white-space:pre">       </span>default_type  application/octet-stream;</div><div> <span class="Apple-tab-span" style="white-space:pre">   </span>sendfile on;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>server_names_hash_max_size 10000;</div><div>        server_names_hash_bucket_size 1024;</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>tcp_nopush on;</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>tcp_nodelay on;</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>keepalive_timeout  10;</div><div> <span class="Apple-tab-span" style="white-space:pre">    </span>gzip on;</div><div> <span class="Apple-tab-span" style="white-space:pre">       </span>gzip_min_length  1100;</div><div> <span class="Apple-tab-span" style="white-space:pre">    </span>gzip_buffers  4 32k;</div><div> <span class="Apple-tab-span" style="white-space:pre">      </span>gzip_types    text/plain  application/x-javascript text/xml text/css;</div><div> <span class="Apple-tab-span" style="white-space:pre">   </span>ignore_invalid_headers on;</div><div> <span class="Apple-tab-span" style="white-space:pre">     </span>client_header_timeout  3m;</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>client_body_timeout 3m;</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>send_timeout     3m;</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>include "/usr/local/nginx/conf/vhost.conf";</div><div> <span class="Apple-tab-span" style="white-space:pre">  </span>include "/etc/cpnginx/cpanelproxy.conf";</div><div>}</div></blockquote><div></div></div><div>And finally</div><div><div></div><blockquote type="cite"><div>root@shadow [/etc/cpnginx]# cat vhost.conf </div><div>client_max_body_size    2000m;</div><div>client_body_buffer_size 512k;</div><div>proxy_send_timeout   90;</div><div>proxy_read_timeout   90;</div><div>proxy_buffer_size    32k;</div><div>proxy_buffers     16 32k;</div><div>proxy_busy_buffers_size 64k;</div><div>proxy_temp_file_write_size 64k;</div><div>proxy_connect_timeout 30s;</div></blockquote><div>In custom, there is only one file, containing the previous posted config.</div><div><br></div><div>Thanks for your help. </div><div></div></div><div>---<br>Ragards, Adnan RIHAN.<br>
<u>Président</u>-<u>Fondateur</u> de l'association (de loi 1901) <a href="http://www.virtual-info.info/" target="_blank"><b>Virtual-Info</b></a>, <i>hébergeur Web et Serveurs de Jeux</i>.<br>
<a href="http://rihan.fr/" target="_blank"><u>Consultant</u></a>-<u>Technicien Supérieur</u> en <i>Informatique de Gestion</i>.<br><u>Ambassadeur</u> <a href="http://lyt.me/7E" target="_blank"><b>Qt</b></a> (Projet <a href="http://rihan.fr/fr/projets/tagpg" target="_blank"><b>Tag-PG</b></a>).<u><br></u></div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">Le mercredi 28 mars 2012 à 08:02, Cliff Wells a écrit :</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>On Wed, 2012-03-28 at 07:16 +0200, Adnan RIHAN wrote:</div><blockquote type="cite"><div><div>I've done this: </div><div><br></div><blockquote type="cite"><div><div>root@shadow [/etc/cpnginx/custom]# cat <a href="http://mega-sound.be">mega-sound.be</a> </div><div>location ~* \.mp3$ {</div><div>types {</div><div>application/octet-stream mp3;</div><div>}</div><div>}</div></div></blockquote><div><br></div><div>But, after rebuilding vhost and restarted nginx, the mp3 are currently</div><div>audio/mpeg (referring to firefox).</div><div>Is there a way to check if the config is correctly "set" ?</div></div></blockquote><div><br></div><div>Start by posting more of your configuration. </div><div><br></div><div>Cliff</div><div><br></div><div><br></div><div><br></div><div>_______________________________________________</div><div>nginx mailing list</div><div><a href="mailto:nginx@nginx.org">nginx@nginx.org</a></div><div><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>