Nginx two locations executed on one request

Issue With below nginx configuration server { listen 2022; location /STFlow/ { rewrite ^/STFlow(.*)$ $1 last; proxy_pass http://zuul-proxy:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-For $http_x_forwarded_for; } location / { set $realip $remote_addr; if ($http_x_forwarded_for ~ "^(\d+\.\d+\.\d+\.\d+)") { set

Continue reading

zk spring boot behind a proxy ( nginx )

Issue I created zk application using zk spring boot starter. Everything works correctly. SpringBootApplication.java: @SpringBootApplication @Controller public class SpringBootApplication { @GetMapping("${application.base-path:}/{page}") public String view(@PathVariable String page) { return page; } public static void main(String[] args) { SpringApplication.run(SpringBootBesGuiApplication.class, args); } }

Continue reading

How to config nginx about proxy_pass?

Issue I run tomcat and my nginx.conf like this If in http://127.0.0.1:8080/edu/b.html or http://192.168.0.102:8080/edu/b.html it’s ok If in http://192.168.0.102:9001/edu/b.html it can’t work my computer ip now is 192.168.0.102 error message [error] 17810#17810: *12 connect() failed (111: Connection refused) while connecting

Continue reading

NGNIX redirect_uri with AWS Cognito

Issue I have a service(Apache Superset) running on localhost:8088. I am trying to connect to AWS Cognito using NGINX as a webserver. My NGINX config is /etc/ngnix/conf.d/superset.conf server { listen 80; server_name in.welcome.com; return 301 https://$host$request_uri; } server { server_name

Continue reading

Why isn't Nginx changing the protocol to WebSocket?

Issue I am trying to run Laracvel-echo. Host configuration: location /socket.io { proxy_pass http://127.0.0.1:6002/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } I catch headers with Socat: socat -v TCP-LISTEN:6002,fork TCP:127.0.0.1:6001 On my DEV server, I

Continue reading

NGINX try_files with name as the last word in the $uri

Issue I’ve got an nginx on my server and I am trying to get it to open the file ‘/config/www/pp1/index.php‘ for address https://example.com/pp1 and ‘/config/www/interpreter/index.html‘ for https://example.com/interpreter. Furthermore all things like https://example.com/interpreter/res/docs should fire up ‘/config/www/interpreter/res/docs.html‘. I have made many

Continue reading

How fix nginx error "invalid number of arguments"?

Issue i try redirect to proxy-server nginx. location /phpmyadmin { proxy_http_version 1.1; proxy_pass https://${PMA}:5000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } But i get error: nginx: [emerg] invalid number of arguments in "proxy_set_header" directive in /etc/nginx/nginx.conf:26 full code for inspect

Continue reading

How do i redirect WWW url to non www url in nginx?

Issue I have an issue with my nginx configuration , i want to redirect www.yoursay.transport.nsw.gov.au to https://yoursay.transport.nsw.gov.au Here is my configuration server { listen 443 ssl; ssl_certificate /etc/letsencrypt/live/yoursay.transport.nsw.gov.au/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/yoursay.transport.nsw.gov.au/privkey.pem; # enable OCSP stapling to speed up first connect ssl_stapling

Continue reading