Custom configuration

Adnan RIHAN adnan at rihan.fr
Fri Mar 30 15:45:05 UTC 2012


Ok.  

Then, here is the vhost:

> #################################################################
> ########### Vhost configuration of  mega-sound.be
> #################################################################
> server {
> access_log off;
> error_log  logs/vhost-error_log warn;
> listen    80;
> server_name  mega-sound.be www.mega-sound.be;
> location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$ {
> expires 24h;
> root /home/megasoun/public_html;
> error_page  404 = @apache;
> access_log /usr/local/apache/domlogs/mega-sound.be;
> log_not_found  off;  
> }  
> location ~ /\.ht {
>           deny all;
> }
>  
> location / {
> log_not_found  off;
>  
>   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;
>  
>         proxy_redirect  http://www.mega-sound.be:8888   http://www.mega-sound.be;
>         proxy_redirect  http://mega-sound.be:8888   http://mega-sound.be;
>         proxy_pass   http://87.98.132.48:8888/;
>         proxy_set_header   Host   $host;
>         proxy_set_header   X-Real-IP  $remote_addr;
>         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
>         }
> location @apache {
> internal;
>  
>   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;
>  
>         proxy_redirect  http://mega-sound.be:8888   http://mega-sound.be;
>         proxy_pass   http://87.98.132.48:8888;
>         proxy_set_header   Host   $host;
>         proxy_set_header   X-Real-IP  $remote_addr;
>         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
>         }
> include "/etc/cpnginx/custom/mega-sound.be";
> }




Here is the included file:

> root at shadow [/usr/local/nginx/conf]# cat /etc/cpnginx/custom/mega-sound.be
> location ~* \.mp3$ {
>         more_set_headers 'X-MyHeader: .mp3';
> }
>  
> location /adata {
>         more_set_headers 'X-MyHeader: adata';
> }
>  
> more_set_headers 'X-MyMasterHeader: set';
> more_set_headers 'X-My2Header: $request_uri';




Here is the HTTP Headers for the root URL (www.mega-sound.be):

> HTTP/1.1 200 OK
> Server: nginx
> Date: Fri, 30 Mar 2012 15:41:35 GMT
> Content-Type: text/html
> Transfer-Encoding: chunked
> Connection: keep-alive
> X-Powered-By: PHP/5.3.10
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
> Pragma: no-cache
> Set-Cookie: slrememberme=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT
> X-MyMasterHeader: set
> X-My2Header: /
> Content-Encoding: gzip




Here is the headers for an MP3 (http://www.mega-sound.be/adata/362.mp3):

> HTTP/1.1 200 OK
> Server: nginx
> Date: Fri, 30 Mar 2012 15:43:04 GMT
> Content-Type: audio/mpeg
> Content-Length: 3258859
> Last-Modified: Wed, 22 Feb 2012 13:52:13 GMT
> Connection: keep-alive
> X-MyMasterHeader: set
> X-My2Heade: /adata/362.mp3
> Expires: Sat, 31 Mar 2012 15:43:04 GMT
> Cache-Control: max-age=86400
> Accept-Ranges: bytes




Is it enough ?
Thank you for your help.
---
Cordialement, 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 vendredi 30 mars 2012 à 10:36, Francis Daly a écrit :

> On Fri, Mar 30, 2012 at 07:08:37AM +0200, Adnan RIHAN wrote:
>  
> Hi there,
>  
> > What can I do T_T ?
>  
> Read http://nginx.org/en/docs/http/request_processing.html
>  
> Look in your config file. Be aware of "include" directives. Look in
> every server{} block. Look at "listen" and "server_name" directives in
> each server{} block.
>  
> Identify which one server{} block is being used to handle this request.
>  
> Post the config for that server{}.
>  
> (If you can additionally identify which one location{} block within
> that server{} block is being used for this request, then you could
> limit what you post to: the server{} block outside of all location{}s,
> plus the content of that one location{}. But that's probably more work
> than is necessary.)
>  
>  
> If you can enable the debug log (will probably require rebuilding
> nginx), then you will see lots of information about what nginx thinks
> is happening.
>  
> But posting the relevant part of the config file is the best way to make
> it easy for people help you.
>  
> f
> --  
> Francis Daly francis at daoine.org (mailto:francis at daoine.org)
>  
> _______________________________________________
> 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/20120330/4fb935c8/attachment.html>


More information about the nginx mailing list