NGINX作为Windows 10中Tomcat 8.5的WebSocket代理

时间:2019-05-02 12:40:45

标签: tomcat nginx reverse-proxy

我试图在Windows 10中将ngnix用作tomcat8.5的反向代理,但是它不起作用。我参考了this

我已经在\ nginx-1.15.12 \ conf \ sites-enabled文件夹中创建了一个名为blah.com.conf的文件

server {
  listen  80; 
  server_name blah.com www.blah.com;

  location / { 
    proxy_pass                          http://127.0.0.1:8080/;
    proxy_set_header Host               $host;
    proxy_set_header X-Real-IP          $remote_addr;  
    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
  }
}

nginx.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    include C:/nginx-1.15.12/conf/sites-enabled/*.conf;

}

0 个答案:

没有答案