Вопрос

I am trying to config a nginx server on an EC2 instance:

What I have done are:

  1. nginx listening 443 with ssl configured
  2. there is a webservice deployed on the ec2 localhost:8086/applications/, this is what I want nginx to proxy to

What I have now is:

location /applications/.* {
  proxy_pass http://localhost:8086
  proxy_redirect default
}

but this doesn't work, when I try POST with url https://<ip>/applications/?wsdl the nginx error.log reads like below:

 [error]15692#0 *1 "/usr/share/nginx/html/applications/index.html" is not found (2: No    such file or directory), client <my_ip>, server: , request "POST /applications/ HTTP/1.1", host: <the_host_ip>

Very noob about nginx here, your help will be appreciated, or direct me to wherever documenting this kind of config please.

Это было полезно?

Решение

You have some ;s missing in your configs and I don't think you need /applications/.* on your location

Try something like this:

listen       80;
server_name  your.website.com;

location /applications {
  proxy_pass http://localhost:8086;
  proxy_redirect off;
}

Make sure you don't have something like this:

location / {
    root   html;
    index  index.html index.htm;
}

Другие советы

It works for me with the following example code. The version of nginx is 1.8.0.

    listen       5554;
    server_name  localhost;

    location / {
        proxy_pass http://soap.example.com;                     
    }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top