nginx-reverse-proxy

nginx how to get the request client ipaddress

本秂侑毒 提交于 2020-03-22 09:51:08
问题 I have ngnix proxying to a nodejs server. I am trying to read the request client ip address/host name in my nodejs, but it's always ::ffff:127.0.0.1 But in my nginx access log, I can see the client ip address printed, not sure why my nodejs server can't get it. x.x.x.x - - [24/Aug/2017:14:28:01 -0700] "GET ...." 回答1: Add the following to your nginx configuration stanza that proxies to NodeJS: proxy_set_header X-Real-IP $remote_addr; Now you can read the header 'X-Real-IP' in NodeJS 回答2: Use

Edit max_conns in Kubernetes ingress Ngnix?

我们两清 提交于 2020-03-03 07:40:07
问题 Im trying to limit the number of concurrent connection to servers in my Nginx ingress. is max_conns supported in Ngnix ingress? how can i edit or add it? max_conns=number limits the maximum number of simultaneous active connections to the proxied server (1.11.5). Default value is zero, meaning there is no limit. If the server group does not reside in the shared memory, the limitation works per each worker process. http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream exmple of

nginx in docker proxy path to subdomain

此生再无相见时 提交于 2020-01-25 07:55:25
问题 What I want is to forward all requests made for: www.domain.com/ api /whaterver/comes/next to -> api .domain.com/whatever/comes/next The reason is to avoid browser CORS for www.domain.com requesting to api.domain.com Probably worth mentioning that nginx is running in a Docker container. I am trying to accomplish with the location block below, but it fails: server { listen 8443 ssl; server_name domain.com www.domain.com; index index.php index.html; root /var/www/base/public; location ~ ^/api/(

reverse proxy with nginx ssl passthrough

社会主义新天地 提交于 2020-01-24 20:37:40
问题 Dear all I have following situation. I have several ISS Webservers hosting multiple web applications on each IIS server. The do have a public certificate on each system. Every IIS has an unique IP. All IIS Server are placed in the same DMZ I have setup an nginx System in another DMZ. My goal is, to have nginx handle all the requests to the IIS from the Internet and JUST passthrough all the SSL and certificates checking to the IIS. So as it was before nginx. I don't want to have nginx break up

Adding CORS header in nginx-proxy appends the value rather than overrides it

回眸只為那壹抹淺笑 提交于 2020-01-16 14:28:31
问题 I'm trying to add a cors header using nginx proxy Docker container https://github.com/jwilder/nginx-proxy. I've create a config file containing the line: add_header 'Access-Control-Allow-Origin' '*' always I've used a volume to pass this in through the docker-compose file at runtime so it appears at /etc/nginx/vhost.d/default But the resulting header in the api response contains two values separated by a comma: http://myapi-domain.com, * This makes cross-domain requests fail with the error:

nginx reverse proxy params docker

一世执手 提交于 2020-01-14 03:33:08
问题 when doing a post to let url = '/api/registerCoin' it works. nginx forwards this to server:3000 , which is good! When I try the post to /api/updatePost with params nginx doesn't seem to point to the server. I am getting: /api/findPostData Failed to load resource: the server responded with a status of 404 (Not Found) in the browser. Is that due to the params being added to the url? I am having the same issue making a post to: POST https://v2.steemconnect.com/api/broadcast 500 () this seems not

configure nginx to make a background request

荒凉一梦 提交于 2020-01-13 05:58:26
问题 I am building an application where I need to do some analytics on the api-data combination usage. Below is my nginx configuration - location /r/ { rewrite /r/(.*)$ http://localhost:3000/sample/route1/$1 redirect; post_action /aftersampleroute1/$1; } location /aftersampleroute1/ { rewrite /aftersampleroute1/(.*) /stats/$1; proxy_pass http://127.0.0.1:3000; } location /r/ is used to redirect the browser request http://localhost:80/r/quwjDP4us to api /sample/route1/quwjDP4us which uses the id

configure nginx to make a background request

删除回忆录丶 提交于 2020-01-13 05:58:06
问题 I am building an application where I need to do some analytics on the api-data combination usage. Below is my nginx configuration - location /r/ { rewrite /r/(.*)$ http://localhost:3000/sample/route1/$1 redirect; post_action /aftersampleroute1/$1; } location /aftersampleroute1/ { rewrite /aftersampleroute1/(.*) /stats/$1; proxy_pass http://127.0.0.1:3000; } location /r/ is used to redirect the browser request http://localhost:80/r/quwjDP4us to api /sample/route1/quwjDP4us which uses the id

How to get around specifying “Host” header to access services pointed by Ingress controllers?

流过昼夜 提交于 2020-01-04 05:37:10
问题 My ingress controller is working and I am able to access the service outside the cluster using http://(externalIP)/path using an HTTP GET request from a RestClient. However, I had to specify the "Host" header with value = "host" (value of my Ingress Resource) for this to work. Because of this, I am not able to hit http://(externalIP)/path from my web browser. Is there any way I can enable access from my external web browser without having to specify "Host" in the request header? Ingress

Keycloak with NGINX proxy server not authenticating rest api

大憨熊 提交于 2019-12-30 05:01:06
问题 I have a sample app which correctly secures the rest api locally without nginx. Now when I put this in production behind a nginx proxy it does not work. No errors. It allows all request. Front end serer with ssl is https://frontend.com Back end server with ssl is https://backend.com Keycloak proxy forward is true Front end server(node server on 9000) <-> NGINX <-> Keycloak (running on 8180) nginx file sample upstream keycloak_server { server localhost:8180; } upstream node_server { server