nginx相同域名不用tomcat端口

来源:互联网 发布:新片场网络暴力 编辑:程序博客网 时间:2024/05/29 03:17

nginx相同域名不用tomcat端口

 

nginx.conf 配置如下:

 

Java代码  收藏代码
  1. #user  nobody;  
  2. worker_processes  1;  
  3.   
  4. #error_log  logs/error.log;  
  5. #error_log  logs/error.log  notice;  
  6. #error_log  logs/error.log  info;  
  7.   
  8. #pid        logs/nginx.pid;  
  9.   
  10.   
  11. events {  
  12.     worker_connections  1024;  
  13. }  
  14.   
  15.   
  16. http {  
  17.     include       mime.types;  
  18.     default_type  application/octet-stream;  
  19.   
  20.     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  
  21.     #                  '$status $body_bytes_sent "$http_referer" '  
  22.     #                  '"$http_user_agent" "$http_x_forwarded_for"';  
  23.   
  24.     #access_log  logs/access.log  main;  
  25.   
  26.     sendfile        on;  
  27.     #tcp_nopush     on;  
  28.   
  29.     #keepalive_timeout  0;  
  30.     keepalive_timeout  65;  
  31.   
  32.     #gzip  on;  
  33.   
  34.     server {  
  35.         listen       8080;  
  36.         server_name  tangxintest.ematong.com;  
  37.           
  38.   
  39.         location /emallwap {  
  40.             proxy_pass http://192.168.1.61:8500;  
  41.             proxy_set_header   Host    $host;  
  42.             proxy_set_header   X-Real-IP   $remote_addr;  
  43.             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
  44.             client_max_body_size 20m;  
  45.                 client_body_buffer_size 128k;  
  46.             proxy_connect_timeout 90;  
  47.             proxy_send_timeout 90;  
  48.             proxy_read_timeout 300;  
  49.             proxy_buffer_size 4k;  
  50.             proxy_buffers 32 4k;  
  51.             proxy_busy_buffers_size 64k;          
  52.         }  
  53.           
  54.         location /teamshop {  
  55.             proxy_pass http://192.168.1.61:8700;  
  56.             proxy_set_header   Host    $host;  
  57.             proxy_set_header   X-Real-IP   $remote_addr;  
  58.             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
  59.             client_max_body_size 20m;  
  60.                 client_body_buffer_size 128k;  
  61.             proxy_connect_timeout 90;  
  62.             proxy_send_timeout 90;  
  63.             proxy_read_timeout 300;  
  64.             proxy_buffer_size 4k;  
  65.             proxy_buffers 32 4k;  
  66.             proxy_busy_buffers_size 64k;          
  67.         }  
  68.           
  69.           
  70.         location /emallweb {  
  71.             proxy_pass http://192.168.1.61:8900;  
  72.             proxy_set_header   Host    $host;  
  73.             proxy_set_header   X-Real-IP   $remote_addr;  
  74.             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
  75.             client_max_body_size 20m;  
  76.                 client_body_buffer_size 128k;  
  77.             proxy_connect_timeout 90;  
  78.             proxy_send_timeout 90;  
  79.             proxy_read_timeout 300;  
  80.             proxy_buffer_size 4k;  
  81.             proxy_buffers 32 4k;  
  82.             proxy_busy_buffers_size 64k;          
  83.         }  
  84.           
  85.           
  86.         location /egoods {  
  87.             proxy_pass http://192.168.1.61:8800;  
  88.             proxy_set_header   Host    $host;  
  89.             proxy_set_header   X-Real-IP   $remote_addr;  
  90.             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
  91.             client_max_body_size 20m;  
  92.                 client_body_buffer_size 128k;  
  93.             proxy_connect_timeout 90;  
  94.             proxy_send_timeout 90;  
  95.             proxy_read_timeout 300;  
  96.             proxy_buffer_size 4k;  
  97.             proxy_buffers 32 4k;  
  98.             proxy_busy_buffers_size 64k;          
  99.         }  
  100.           
  101.           
  102.   
  103.         #error_page  404              /404.html;  
  104.   
  105.         # redirect server error pages to the static page /50x.html  
  106.         #  
  107.         error_page   500 502 503 504  /50x.html;  
  108.         location = /50x.html {  
  109.             root   html;  
  110.         }  
  111.   
  112.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80  
  113.         #  
  114.         #location ~ \.php$ {  
  115.         #    proxy_pass   http://127.0.0.1;  
  116.         #}  
  117.   
  118.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000  
  119.         #  
  120.         #location ~ \.php$ {  
  121.         #    root           html;  
  122.         #    fastcgi_pass   127.0.0.1:9000;  
  123.         #    fastcgi_index  index.php;  
  124.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
  125.         #    include        fastcgi_params;  
  126.         #}  
  127.   
  128.         # deny access to .htaccess files, if Apache's document root  
  129.         # concurs with nginx's one  
  130.         #  
  131.         #location ~ /\.ht {  
  132.         #    deny  all;  
  133.         #}  
  134.     }  
  135.   
  136.   
  137.     # another virtual host using mix of IP-, name-, and port-based configuration  
  138.     #  
  139.     #server {  
  140.     #    listen       8000;  
  141.     #    listen       somename:8080;  
  142.     #    server_name  somename  alias  another.alias;  
  143.   
  144.     #    location / {  
  145.     #        root   html;  
  146.     #        index  index.html index.htm;  
  147.     #    }  
  148.     #}  
  149.   
  150.   
  151.     # HTTPS server  
  152.     #  
  153.     #server {  
  154.     #    listen       443 ssl;  
  155.     #    server_name  localhost;  
  156.   
  157.     #    ssl_certificate      cert.pem;  
  158.     #    ssl_certificate_key  cert.key;  
  159.   
  160.     #    ssl_session_cache    shared:SSL:1m;  
  161.     #    ssl_session_timeout  5m;  
  162.   
  163.     #    ssl_ciphers  HIGH:!aNULL:!MD5;  
  164.     #    ssl_prefer_server_ciphers  on;  
  165.   
  166.     #    location / {  
  167.     #        root   html;  
  168.     #        index  index.html index.htm;  
  169.     #    }  
  170.     #}  
  171.   
  172. }  

 

获取【下载地址】   【免费支持更新】
三大数据库mysql  oracle  sqlsever   更专业、更强悍、适合不同用户群体
新录针对本系统的视频教程,手把手教开发一个模块,快速掌握本系统
A 集成代码生成器 [正反双向(单表、主表、明细表、树形表,开发利器)+快速构建表单;
freemaker模版技术 ,0个代码不用写,生成完整的一个模块,带页面、建表sql脚本,处理类,service等完整模块
B 集成阿里巴巴数据库连接池druid;
  数据库连接池  阿里巴巴的 druid。Druid在监控、可扩展性、稳定性和性能方面都有明显的优势
C集成安全权限框架shiro ;
  Shiro 是一个用 Java 语言实现的框架,通过一个简单易用的 API 提供身份验证和授权,更安全,更可靠
D 集成ehcache 分布式缓存 ;
  是一个纯Java的进程内缓存框架,具有快速、精干等特点,广泛使用的开源Java分布式缓存。
E 集成微信接口开发;    F 图片爬虫技术;   G  SQL 编辑器, 支持复杂sql语句,生成报表,可以导出excel
H websocket及时通讯技术(即时聊天、及时站内信并声音提醒、实时在线管理、websocket及时刷新页面);

 

 

0 0
原创粉丝点击