Skip to content

Instantly share code, notes, and snippets.

@windsting
Last active August 29, 2017 14:18
Show Gist options
  • Save windsting/0721f8cdadfacb0652e061a3784b3428 to your computer and use it in GitHub Desktop.
Save windsting/0721f8cdadfacb0652e061a3784b3428 to your computer and use it in GitHub Desktop.
Nginx 端口转发配置

存一下,免得下次再花时间找了

  server {
    listen 80;  # 一般都是想转发到标准的80端口吧,不是的话,改一下
    server_name DOMAIN.NAME;  # 指向这个主机的域名
    location / {
      proxy_pass http://localhost:PORT; # PORT 是在本地监听的实际端口
      proxy_redirect default;
    }
  }

好了,就是这么简单

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment