Welcome! Log In Create A New Profile

Advanced

Re: how to install nginx_substitutions_filter in existing Nginx

Francis Daly
June 21, 2017 06:10PM
On Sun, Jun 18, 2017 at 09:59:43PM -0400, David Woodstuck wrote:

Hi there,

> I have a host Nginx server running in port: 9000, This Nginx will proxy
> http://www.myserver.com:10085/. Some pages from
> http://www.myserver.com:10085/ have a lot of iframes whose srcs are
> http://www.myserver.com:10088/ and http://www.myserver.com:10089/. I cannot
> get access to http://www.myserver.com:10085/, http://www.myserver.com:10088/
> and http://www.myserver.com:10089/. I want the pages from
> http://www.myserver.com:10085/ to have CORS( add_header
> 'Access-Control-Allow-Origin' '*'). How do I achieve this?

You have nginx on port 9000 which does "proxy_pass http://www.myserver.com:10085;".

You want responses from the upstream port 10085 to include this extra header.

Put "add_header Access-Control-Allow-Origin *;" in the same location{}
as the proxy_pass.

You can test, using something like "curl -v", to confirm that the response
to a request to port 9000 does not refer to port 10085 at all, and that
it includes the extra header.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

how to install nginx_substitutions_filter in existing Nginx

David Woodstuck June 06, 2017 12:28AM

Re: how to install nginx_substitutions_filter in existing Nginx

Francis Daly June 06, 2017 01:22PM

Re: how to install nginx_substitutions_filter in existing Nginx

David Woodstuck June 18, 2017 10:08PM

Re: how to install nginx_substitutions_filter in existing Nginx

Francis Daly June 21, 2017 06:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 322
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