Re: how to install nginx_substitutions_filter in existing Nginx
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 Dalyfran...@daoine.org ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: how to install nginx_substitutions_filter in existing Nginx
Thank Francis for your help. I just install nginx_substitutions_filter from source. It works well as expected. I have a special requirement I will describe below. 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? Thanks, David On Tue, Jun 6, 2017 at 1:21 PM, Francis Dalywrote: > On Tue, Jun 06, 2017 at 12:27:04AM -0400, David Woodstuck wrote: > > Hi there, > > > I am a new Nginx user. I just install Nginx 1.12. I like to > > use nginx_substitutions_filter. I cannot figure out how to install > > nginx_substitutions_filter in previously existing Nginx. > > You (probably) don't. > > https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/ > > describes how to build from source in general; > > https://www.nginx.com/resources/wiki/modules/substitutions/ > > describes how to include the modules you mention, in specific. > > > Should I unstall Nginx first? > > You can run "nginx -V" to see the "configure" arguments that were used > to create your current version. Then add the extra bits that you want. > > Depending on precisely how you installed your current nginx, you probably > *do* want to uninstall it before installing the new one. > > > If your current nginx supports dynamic modules (1.12 does), and if > this extra module you want supports being built as a dynamic module, > then you may be able to build-and-add the module. > > I suspect that in your case, you will probably find more clear > documentation on how to build-and-maintain a new nginx than how to > build-and-maintain the extra module. > > I also suspect that, based on parallel mail threads, you probably do > not need the extra module. > > It is still useful to know how to add a module that you want, so it is > certainly worth trying it on a test system, at least. > > Good luck with it, > > f > -- > Francis Dalyfran...@daoine.org > ___ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx > ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: how to install nginx_substitutions_filter in existing Nginx
On Tue, Jun 06, 2017 at 12:27:04AM -0400, David Woodstuck wrote: Hi there, > I am a new Nginx user. I just install Nginx 1.12. I like to > use nginx_substitutions_filter. I cannot figure out how to install > nginx_substitutions_filter in previously existing Nginx. You (probably) don't. https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/ describes how to build from source in general; https://www.nginx.com/resources/wiki/modules/substitutions/ describes how to include the modules you mention, in specific. > Should I unstall Nginx first? You can run "nginx -V" to see the "configure" arguments that were used to create your current version. Then add the extra bits that you want. Depending on precisely how you installed your current nginx, you probably *do* want to uninstall it before installing the new one. If your current nginx supports dynamic modules (1.12 does), and if this extra module you want supports being built as a dynamic module, then you may be able to build-and-add the module. I suspect that in your case, you will probably find more clear documentation on how to build-and-maintain a new nginx than how to build-and-maintain the extra module. I also suspect that, based on parallel mail threads, you probably do not need the extra module. It is still useful to know how to add a module that you want, so it is certainly worth trying it on a test system, at least. Good luck with it, f -- Francis Dalyfran...@daoine.org ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx