IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    nginx部署go,python等的脚本

    istrone发表于 2014-12-24 14:00:59
    love 0
    server {
        listen       80;
        server_name  .a.com;
    
        charset utf-8;
        access_log  /home/a.com.access.log  main;
    
        location /(css|js|fonts|img)/ {
            access_log off;
            expires 1d;
    
            root "/path/to/app_a/static"
            try_files $uri @backend
        }
    
        location / {
            try_files /_not_exists_ @backend;
        }
    
        location @backend {
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host            $http_host;
    
            proxy_pass http://127.0.0.1:8080;
        }
    }
    
    

    iptables禁止外网访问本机8080端口:

    iptables -I INPUT -p tcp --dport 81 -j DROP
    
    
    Maybe you like these:
    ubuntu nginx 通过php5-fpm运行codeigniter应用程序配置
    nginx 分割日志shell
    ubuntu 11.10 安装和简单配置 nginx
    ubuntu下整合tomcat和nginx
    ubuntu部署C/C++环境
    无觅


沪ICP备19023445号-2号
友情链接