OSCHINA 联通代理节点的 Nginx 配置

   server {
       include listen.conf;
       server_name  *.oschina.net;
       error_log /dev/null;
       access_log off;#/disk2/logs/oschina.log;

       location ~ ^/(img|css|js)/ {
           expires 1d;
           root /data/nginx_cache/oschina;
           proxy_store on;
           proxy_store_access user:rw group:rw all:rw;
           proxy_temp_path /data/nginx_cache/oschina;
           include proxy.conf;
           if ( !-e $request_filename) {
           proxy_pass  https://61.145.122.155:80;
           }
       }

       location ~ ^/uploads/user {
           expires 1d;
           include proxy.conf;
           proxy_pass  https://61.145.122.155:80;
       }

       location ~ ^/uploads {
           expires 7d;
           root /data/nginx_cache/oschina;
           proxy_store on;
           proxy_store_access user:rw group:rw all:rw;
           proxy_temp_path /data/nginx_cache/oschina;
           include proxy.conf;
           if ( !-e $request_filename) {
           proxy_pass  https://61.145.122.155:80;
           }
       }

       location / {
           proxy_pass  https://61.145.122.155:80;
           include proxy.conf;
       }

   }

   server {
       listen       443 ssl;
       server_name  *.oschina.net;
ssl                  on;
ssl_certificate      /home/oschina/oschina-chain.crt;
ssl_certificate_key  /home/oschina/oschina.key;

location ~ ^/(img|css|js)/ {
           expires 1d;
           root /data/nginx_cache/oschina;
           proxy_store on;
           proxy_store_access user:rw group:rw all:rw;
           proxy_temp_path /data/nginx_cache/oschina;
           include proxy.conf;
           if ( !-e $request_filename) {
           proxy_pass  https://61.145.122.155:443;
           }
       }

       location / {
           include proxy.conf;
           proxy_pass   https://61.145.122.155:443;
       }

   }

你可能感兴趣的:(OSCHINA 联通代理节点的 Nginx 配置)