New answers tagged

0

Shot in the dark - should both instances (Nginx and node) run on the same host, could it be that your node.js instance is not listening on 127.0.0.1? You may try app.listen(8080, '127.0.0.1'); Do both instances run on the same host?


0

I have solved this modifying some config files in NGINX and Tomcat. In NGINX, I have deleted the proxy-cache lines I've written in the server configuration. In Tomcat, I have set context.xml as follows: <Context path="/" reloadable="false" override="true" useNaming="false" allowLinking="true" ...


0

This is like WAY too late, but I stumbled upon this and ended up figuring it out. This has to be in your location block: proxy_pass_header Authorization; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; ...


2

The certificate of a domain should go where the clients "see" it, so in your case, if you want only the nginx server to be available from the internet, all of the public certificates should go to the nginx server. If you want to secure the backend connections, you can use whatever certificate you want on those servers. You can even use self-signed ones, and ...


1

There are quite some possibilities, here are 2: You have 1 certificate on your reverse proxy containing all your domains using SANs You redirect every domain from your nginx to their corresponding server, rewriting the URLs Either you have your clients communicate solely with your reverse proxy (1) and nginx will handle connections to the upstream servers,...


0

You can disable Nginx file buffering by setting proxy_max_temp_file_size to 0. The documentation on this directive says as much: The zero value disables buffering of responses to temporary files. https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size


4

The documentation states that if you use variables in the proxy_pass directive and you specify a URI part, it will be passed upstream "as is". You will need to capture the part of the URI you need to send upstream. Either use a regular expression location block, for example: location ~ ^/api(.*)$ { set $upstream ...; proxy_pass http://$upstream$1; }...


0

server{ listen 80; server_name domain.com; location ~ ^/project?(.*) { proxy_pass http://10.1.1.5:80$1$is_args$args; } } Probably you need something like this.


1

Block all direct connections to port 8000/8001: Close the firewall for ports 8000/8001 with IPtables/firewalld/ufw Disallow any external IP addresses to access your content on 8000/8001 (requests from nginx will come from localhost). Then you say “I have a few problems”. It isn’t really clear what those problems are. I’m assuming that your applications ...


0

location / { if ($arg_url) { proxy_pass $arg_url; proxy_set_header Host $host; proxy_set_header Referer $http_referer; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; } } Can you try this? You check the query string (?url=http://foo:8088/images/image123.jpg ) exists , ...


1

@Terabuck Sorry for not replying no rep yet. You should not use localhost because you are depending on the fact that application is running on a server with a hosts file. local host is only a default translation to 127.0.0.1. There is nothing stating that you must have this hosts files. It's just very common to have one. Having a loopback interface is ...


-1

I will move the logic to the load balancer, if it is not possible to replace the existent load balancer, install a small nginx in each Apache server to proxy the connection. [User] - [Load Balancer] - [Nginx] - [Apache] By using nginx as load balancer or reverse proxy you have access to the upstream responses (In your case, Apache), and you can make rules ...


2

Haproxy can reject tcp connections based on dynamic conditions, including the number of servers available on the backend. The config keyword is tcp-request connection. (Link to docs below.) So, maybe put haproxy in front of Apache (I know, I know! Three layers?!?!) or maybe use haproxy instead of Apache. Might look like this (not tested): frontend http-in ...


0

no, DNS can't redirect the request to a different TCP Port, what DNS does is resolve fqdn do IP, if you need to change the request from one TCP port to another you need something to forward the request. Please check if this helps: Nginx: How do I forward a http request to another port?


0

This will probably not work with apache httpd itself. The problem is that your failed application makes apache httpd generate an error. This error only happens when you actually request an URL from that application. Apache httpd needs the URL to decide wether this is an error or not and to get the URL from the client it needs the TCP connection. What you ...


0

Extending chrskly's answer, you might want to configure 3 flags/configs. fail_timeout : Total time by failed attempts and also mark the server as DOWN for that same time. If 5 sec, then will try max_fail attempts in 5 secs and if still fails, mark that server as DOWN for 5 sec. max_fail : Maximum number of tries proxy_connect_timeout : The amount of time ...


1

I recently moved a wordpress site from an apache server which ran it well enough I dont know the TTFB but I decided to change to NGINX for the new server and it works fantastically. My setup for the Fastcgi for the fastcgi_pass this should change to whatever version of php fpm you install. location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+...


0

I managed to turn on Outlook Anywhere without installing a reversing proxy server. The steps I took were: 1) Enable Outlook Anywhere in CAS server 2) Create external DNS CNAME record for autodiscover.domain.name to point to the CAS server. That's it. The same Outlook profile can be used inside and outside the domain.


0

I was able to solve the problem by following the excellent cPanel documentation, I hope it can help someone else. Remembering that the includename.conf files can not count the VirtualHost tag, just the content inside it. https://documentation.cpanel.net/display/EA4/Modify+Apache+Virtual+Hosts+with+Include+Files


-1

Please note that 'localhost' might not work in some configurations, so it might be useful to change it to '127.0.0.1'


0

This will work using rewrite: location /internalserver { rewrite /internalserver/(.*) /$1 break; proxy_pass http://192.xx.xx.15:9010; proxy_redirect off; proxy_set_header Host $host; } In your case you should not need rewrite at all though, just specify the exact url in proxy_pass: location /internalserver { ...


0

I'm closing out this question. The answer is fairly complicated. I commented on my post with a reference to a project that was helpful in figuring things out. I am still working on some documentation that will be helpful for others/myself in the future but that is going to take some time. Also, I have created a few diagrams that might be helpful for ...


0

I don't think you'll be able to achieve what you're trying to do: As you've seen, once you present a certificate the listener stops "blindly" proxying encrypted traffic straight to the correct backend, and instead tries to terminate all client TLS connections using the certificate(s) provided, failing if it can't provide a valid one for the domain requested. ...


1

It's not a requirement, but it's a nice way of lessening the impact of (CAS) downtime if you're running an Exchange cluster. If you're not, a reverse proxy may still give you an additional layer of defense, if configured to do so. However, if that's not part of the plan I'd say it's just another moving part that needs understanding and maintenance, so you're ...


0

Can I set up the Docker containers so that some are only accessible inside the network and some outside? Don't add the domains to your DNS. For your intranet containers use a domain such as myservice.myintranet.local, which won't be resolvable from the outside. If you want extra security, you can create another entrypoint with an IP whitelist. Or you can ...


0

If you want to process 404 responses in the reverse proxy, you will need to intercept them. See this document for details. For example: location / { proxy_pass http://...; ... proxy_intercept_errors on; error_page 404 =302 /some/other/page; }


0

I fixed it myself, by just going step by step. I started with this: server { listen 80; location / { proxy_pass http://192.x.x.2; } } And then I added extra options step by step. I found the options and their descriptions on http://nginx.org/en/docs/http/ngx_http_proxy_module.html. I finally ended up with the ...


0

the correct code is : AddOutputFilterByType SUBSTITUTE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json Substitute "s|https:\/\/localserver:9251|https:\/\/publicnameserver:9251|ni" with mod substitute I have replaced the localserver with publicnameserver. thanks for your help.


0

found it !!! I have added the substtute mod to modify the server response and it's work !!!!! commande added: AddOutputFilterByType SUBSTITUTE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json Substitute "s|https:\/\/localserver:9251|https:\/\/publichostname:9251|ni" thanks for your helps !!!!


Top 50 recent answers are included