reverse-proxy

Nginx reverse proxy - deny access to specific backend IP addresses

折月煮酒 提交于 2020-03-05 03:59:49
问题 I'm running Nginx reverse proxy using proxy_pass directive from ngx_http_proxy_module. Is there a way to forbid access to certain backend IP address ranges? I've tried this but that doesn't seem to work. 来源: https://stackoverflow.com/questions/60223175/nginx-reverse-proxy-deny-access-to-specific-backend-ip-addresses

Nginx Reverse Proxy upstream not working

可紊 提交于 2020-02-28 07:35:48
问题 I'm having trouble figuring out load balancing on Nginx. I'm using: - Ubuntu 16.04 and - Nginx 1.10.0. In short, when I pass my ip address directly into "proxy_pass", the proxy works: server { location / { proxy_pass http://01.02.03.04; } } When I visit my proxy computer, I can see the content from the proxy ip... but when I use an upstream directive, it doesn't: upstream backend { server 01.02.03.04; } server { location / { proxy_pass http://backend; } } When I visit my proxy computer, I am

CloudFront how to setup reverse proxy on an existing distribution serving website from S3

家住魔仙堡 提交于 2020-02-28 06:27:56
问题 I have a S3 bucket which hosts a website and is delivered with CloudFront and right now I have attached the distribution to my apex root domain like - www.xyz.com So, previously we were using Nginx to serve a static frontend from a webserver root on the same domain - www.xyz.com and had also setup a reverse proxy - www.xyz.com/api/** which routed traffic to upstream backend server on the same machine. Now, I would like to move the website to S3 but still run the backend API on the same

CloudFront how to setup reverse proxy on an existing distribution serving website from S3

给你一囗甜甜゛ 提交于 2020-02-28 06:27:12
问题 I have a S3 bucket which hosts a website and is delivered with CloudFront and right now I have attached the distribution to my apex root domain like - www.xyz.com So, previously we were using Nginx to serve a static frontend from a webserver root on the same domain - www.xyz.com and had also setup a reverse proxy - www.xyz.com/api/** which routed traffic to upstream backend server on the same machine. Now, I would like to move the website to S3 but still run the backend API on the same

Nginx $upstream_addr variable doesn't work in if condition

折月煮酒 提交于 2020-02-25 06:31:47
问题 I'm running a reverse proxy using proxy_pass directive from ngx_http_proxy_module. I want to forbid access to certain backend IP address ranges (like 172.0.0.0/24 ). I've tried if ($upstream_addr ~* "^172.*") { return 403; } add_header X-mine "$upstream_addr"; both in server and location context but it doesn't work, i.e. Nginx still returns 200: $ curl localhost -I HTTP/1.1 200 OK Server: nginx/1.17.0 Date: Thu, 13 Feb 2020 12:58:36 GMT Content-Type: text/html Content-Length: 612 Connection:

Nginx $upstream_addr variable doesn't work in if condition

岁酱吖の 提交于 2020-02-25 06:30:34
问题 I'm running a reverse proxy using proxy_pass directive from ngx_http_proxy_module. I want to forbid access to certain backend IP address ranges (like 172.0.0.0/24 ). I've tried if ($upstream_addr ~* "^172.*") { return 403; } add_header X-mine "$upstream_addr"; both in server and location context but it doesn't work, i.e. Nginx still returns 200: $ curl localhost -I HTTP/1.1 200 OK Server: nginx/1.17.0 Date: Thu, 13 Feb 2020 12:58:36 GMT Content-Type: text/html Content-Length: 612 Connection:

What does the Resolver param in nginx do?

那年仲夏 提交于 2020-02-21 11:06:21
问题 I am using nginx as a reverse_proxy server with ELB. I am looking for explanation regarding the resolver value I set in the nginx.conf file. My nginx.conf: http { ... resolver x.x.x.x valid=30s; ... } server { ... set $elb "example.com"; location / { ... rewrite ^/(.*) $1 break; proxy_pass http://$elb/$1?$args; ... } ... } I followed this - https://www.ruby-forum.com/topic/6816375#1166569 and set /etc/resolv.conf value as the resolver value and it works fine. What is standing behind this? 回答1

Nginx does redirect, not proxy

耗尽温柔 提交于 2020-02-20 06:26:09
问题 I want to set up Nginx as a reverse proxy for a https service, because we have a special usecase where we need to "un-https" a connection: http://nginx_server:8080/myserver ==> https://mysecureservice But what happens is that the actual https service isn't proxied. Nginx does redirect me to the actual service, so the URL in the browser changes. I want to interact with Nginx as it was the actual service, just without https. This is what I have: server { listen 0.0.0.0:8080 default_server;

NGINX - Reverse proxy multiple API on different ports

孤者浪人 提交于 2020-01-31 03:19:25
问题 I have the following API(s): localhost:300/api/customers/ localhost:400/api/customers/:id/billing localhost:500/api/orders I'd like to use NGINX to have them all run under the following location: localhost:443/api/ This seems very difficult because of customers spanning two servers. Here's my failed attempt starting with orders server { listen 443; server_name localhost; location /api/orders { proxy_pass https://localhost:500/api/orders; proxy_set_header Host $host; proxy_set_header X

Apache & Tomcat: ProxyPass and ProxyPassReverse

醉酒当歌 提交于 2020-01-30 14:36:29
问题 I'am having troubles configuring Apache and Tomcat, this is the scenario: I have an Apache Web Server, running and working normally, I can access to this one just typing: http://localhost Also, in this host, I have a Tomcat running and working fine; I've created a mini web-app which files are inside "prueba" directory, I can access typing: http://localhost:8080/prueba (I know that Apache is running in 80 port and Tomcat in 8080) What I want to do is that througt Apache an user can access to