Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup a proxy server using nginx. The server is running Windows Server 2003 and running IIS and tomcat. What I'm trying to achieve is to redirect call say from to the internal server that is on

This is my first time dealing with nginx and I'm a bit frustrated with it. NGINX config

server {
    listen       80;

    access_log  logs/host.access.log  main;

    location / {
        #proxy_set_header   Host;
        #proxy_set_header   X-Host;
        #proxy_set_header   X-Real-IP             $remote_addr;
        #proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

I'm getting a 404 error when trying to access the address.

share|improve this question

migrated from Jul 21 '09 at 2:41

This question came from our site for professional and enthusiast programmers.

Belongs to ServerFault. – LiraNuna Jul 21 '09 at 1:32

You can be redirected to your upstream server like this :

http {
    upstream myserver {;

     server {
         listen 80;

         access_log logs/host.access.log main;

    location / {
        proxy_pass http://myserver/orderpad;

share|improve this answer

don't you have to have the full "http://..." URI in your proxy pass?

Example: Nginx LoadBalance Example

EDIT: Oh and if you wanted URIs such as /orderpad/testthing, then you need the trailing slash '/' otherwise it'll end up as /orderpadtestthing

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.