how to handle "server_name" in intranet environment

Bert Douglas bertd at douglascircuitworks.com
Fri Sep 7 17:44:50 MSD 2007


Igor Sysoev <is at ...> writes:

> Have you tried in browser or telnet and so ?
> Browser may cache permanent redirect.

This is nginx config file:

user nginx nginx;
worker_processes  1;

events {
  worker_connections  1000;
  use epoll;
}

http {
  include        mime.types;
  default_type   application/octet-stream;

 upstream mosaic {
    server 127.0.0.1:8811;
  }

  server {
    listen       443;
    server_name  _ *;
    optimize_server_names off;

    ssl                         on;
    ssl_certificate             server.crt;
    ssl_certificate_key         server.key;
    ssl_prefer_server_ciphers   on;

     location /mosaic/ {
      proxy_pass        http://mosaic;
      proxy_set_header  X-Real-IP          $remote_addr;  
      proxy_set_header  Host               $proxy_host;
    }

    location / {
      deny all;
    }
  }

  server {
    listen 80;
    server_name  _ *;
    optimize_server_names off;

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


This is curl transcript:

$ curl -v -k https://127.0.0.1/mosaic

(some lines elided)

> GET /mosaic HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c
zlib/1.2.3 libidn/0.6.5
> Host: 127.0.0.1
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Server: nginx/0.6.9
< Date: Fri, 07 Sep 2007 13:32:08 GMT
< Content-Type: text/html
< Content-Length: 184
< Location: https://127.0.0.1/mosaic/
< Connection: keep-alive
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.9</center>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):









More information about the nginx mailing list