Re: Override Content-Type header with proxied requests

2015-05-24 Thread Pavel Vasev
Dear Manish! Could you please share the file with mime types that you use to include in a map? manish-ezest wrote in post #1155024: > Hello Wandenberg, > > Thanks for your help. Finally it is working. I included all the mime > types > in a file and included inside map directive and used it in the

Re: Override Content-Type header with proxied requests

2014-08-13 Thread manish-ezest
Hello Wandenberg, Thanks for your help. Finally it is working. I included all the mime types in a file and included inside map directive and used it in the location / {} directive with proxy hide parameter like you suggested. --Manish Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239

Re: Override Content-Type header with proxied requests

2014-08-09 Thread flygoast
I wrote a module to process the problem ena.https://github.com/flygoast/ngx_http_types_filter our configuration in production like this: location / { types_filter $uri; .. proxy_pass http://down_server; } At 2014-08-09 10:34:06,manish-ezest wrote: >Hello Wandenberg, > >Yes, t

Re: Override Content-Type header with proxied requests

2014-08-08 Thread manish-ezest
Hello Wandenberg, Yes, the back-end(s3 bucket) is sending Content-Type header for each request and what I heard from the developers that the header is must for the site to work properly. The issue started when I got the request of enabling content-type header of all the json files to application

Re: Override Content-Type header with proxied requests

2014-08-08 Thread Wandenberg Peixoto
One question, your backend are sending the content-type header if you made the request to it? If yes, the value is right? If not, I think the problem is on backend configuration. You can set it on the nginx using the map like I suggest, but will have to add all possible file types on the map, like

Re: Override Content-Type header with proxied requests

2014-08-08 Thread manish-ezest
Hello wandenberg, This procedure is not working for internet explorer. The CSS are not loading properly. so we have to somehow get the Content-Type in the header. Is there anything we can use? --Manish Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239473,252416#msg-252416 __

Re: Override Content-Type header with proxied requests

2014-08-07 Thread manish-ezest
Hi Wandenberg, Is there any way to show the Content-Type in the header as well? --Manish Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239473,252396#msg-252396 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinf

Re: Override Content-Type header with proxied requests

2014-08-07 Thread manish-ezest
Hi Wandenberg, As you suggested I added "proxy_hide_header Content-Type;" in location / {} directive and I am getting 200 but how would I check what is the Content-Type. I usually check with curl command. But with curl command I don't find the Content-Type since it is hidden now. Is there any oth

Re: Override Content-Type header with proxied requests

2014-08-07 Thread Wandenberg Peixoto
Did you tried to only hide the header with proxy_hide_header Content-Type; and let nginx use the mime.types to set the content type? Do not set the add_header Content-Type manually. Let me know the result. On Thu, Aug 7, 2014 at 12:57 PM, manish-ezest wrote: > Hello wandenberg, > > Thank you

Re: Override Content-Type header with proxied requests

2014-08-07 Thread manish-ezest
Hello wandenberg, Thank you for your response. I truly appreciate your help. I tried this options given below ##First Method### 1. Edit nginx.conf and add map $uri $custom_content_type { default "text/html"; ~(.*\.json)$ "application/json"; } 2. Put the cu

Re: Override Content-Type header with proxied requests

2014-08-06 Thread Wandenberg Peixoto
Hello, you can use many values on the map, take a look on its docs. One quickly example may be (not tested) map $uri $custom_content_type { default "text/html"; ~(.*\.json)$ "application/json"; } location ~ \.json$ { proxy_hide_header Content-Type; add_header Content-Typ

Re: Override Content-Type header with proxied requests

2014-08-06 Thread manish-ezest
Hello All, Can somebody answer this question? I am facing this issue from many days. --Manish Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252360,252378#msg-252378 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/li

Override Content-Type header with proxied requests

2014-08-06 Thread manish-ezest
Please refer this page http://forum.nginx.org/read.php?2,239473,252358#msg-252358 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252360,252360#msg-252360 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Override Content-Type header with proxied requests

2014-08-06 Thread manish-ezest
Hello Appa, I am having the same issue. I want NGINX to serve all the json file from upstream as a content type of application/json.I tried with map just like you suggested but I am not able to figure out what should be inside map(That you have written below), Can you please suggest? map $upstrea

Re: Override Content-Type header with proxied requests

2013-05-24 Thread andrea.mandolo
Thanks for the reply!! This approach can be a good solution. I wonder if this can affect the server perfomance. Another solution could be to create a location for each file extension that only adds the correct Content-Type header. This is certainly less maintainable than a map, but is it better f

Re: Override Content-Type header with proxied requests

2013-05-23 Thread António P . P . Almeida
Oops it's $upstream_http_content_type instead. Should read: map $upstream_http_content_type $s3_content_type { # S3 -> real... } appa On Thu, May 23, 2013 at 5:24 PM, António P. P. Almeida wrote: > Try this. > > At the http level define a map directive that maps upstream Content-Type

Re: Override Content-Type header with proxied requests

2013-05-23 Thread António P . P . Almeida
Try this. At the http level define a map directive that maps upstream Content-Types to the correct ones. map $upstream_content_type $s3_content_type { # S3 -> real... } On the location that proxy passes. proxy_hide_header Content-Type; add_header Content-Type $s3_content_type; appa

Re: Override Content-Type header with proxied requests

2013-05-23 Thread Jonathan Matthews
Here's a thread I started on this a while back. I didn't get any replies. http://mailman.nginx.org/pipermail/nginx/2011-September/029344.html Jonathan -- Jonathan Matthews // Oxford, London, UK http://www.jpluscplusm.com/contact.html ___ nginx mailing

Override Content-Type header with proxied requests

2013-05-23 Thread andrea.mandolo
Hi !! i have a Nginx server that operates as a reverse proxy to a my bucket in Amazon S3. Amazon S3 service could deliver contents with wrong Content-Type header, so i would like to override this header by referring to file extension. In other servers i have just configured the "types" block wit