1

I have read several similar questions to this one in this forum, but not exactly the same, I tried every solution in very different ways but I am not able to manage this.

I was given some data about a server. In this server, I have to install an application which is going to run in https://localhost:31070/?a=bbb. I did that, and now, I can access from any computer to the application writing https://xxx.xxx.xxx.xxx:31070/?a=bbb. I installed nginx on that server as the HTTP server, to make this work.

Now, I was given a domain my.domain.com. They want to type my.domain.com on the URL and go directly to the application (go to https://localhost:31070/?a=bbb). I was working with virtualhosts in nginx, but I do not know if this is the right way to manage that.

Anyone can help me? This is my virtualhost:

server {
    listen 80;
    server_name  my.domain.com;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass https://127.0.0.1:31070/;
    }
}

This is stored in a file called domain in /etc/nginx/sites-available/ which is enabled, by the way. I also edited the file /etc/hosts, adding the line xxx.xxx.xxx.xxx my.domain.com. My problem is: if I type my.domain.com on the URL, I see nothing.

EDIT I think the virtualhost is OK, but the problem could be that my.domain.com is not being recognised by remote hosts.

forvas
  • 161
  • 1
  • 9
  • This is the third time you've asked a very similar question about this broken application. The solution is to fix the application. – Michael Hampton Sep 05 '14 at 14:19
  • @MichaelHampton the application is not broken. I managed to do what I want with Apache2 in localhost. But now, I was told to do it with nginx. I tried to follow the same steps as I did in Apache2, but is not the same as I am checking. – forvas Sep 05 '14 at 14:28
  • What exactly is your problem? Did you take a look at the `proxy_pass` directive in nginx? – etagenklo Sep 05 '14 at 14:48
  • @etagenklo Yes, I am using it. I am going to paste my virtualhost to let you see what I did. – forvas Sep 05 '14 at 14:54
  • Is the port 30070 or 31070? – etagenklo Sep 05 '14 at 15:17
  • @etagenklo Sorry I pasted the old code, but in fact, for the moment I do not mind if it redirects me to 30070 with http or 31070 with https. Because the app is running on both ports with different secure protocols. – forvas Sep 05 '14 at 15:25
  • Anything in your nginx log? – etagenklo Sep 05 '14 at 15:29
  • @etagenklo nothing, everything is fine. – forvas Sep 05 '14 at 15:39

0 Answers0