nginx配置域名访问
-
可参考 主要配置如下
#gzip on; 34 35 upstream testnginx{ 36 server localhost:8080; 37 #server localhost:8081; 38 } 39 server { 40 listen 80; 41 server_name www.testnginx.com; 42 43 #charset koi8-r; 44 45 #access_log logs/host.access.log main; 46 47 location / { 48 proxy_pass http://testnginx; 49 #proxy_pass http://localhost:8080; 50 #proxy_set_header Host $http_host; 51 #proxy_set_header X-Real-IP $remote_addr; 52 #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 53 #index index.html index.htm; 54 } 55 56 #error_page 404 /404.html;