赞
踩
#nginx服务器环境(自己情况)
FROM jd-new-centos6-nginx
#将当前编译后的dist文件复制到另一个位置
COPY dist /opt/dist
COPY http-nginx.conf /opt/nginx/conf/domains/
ENTRYPOINT /usr/sbin/sshd && mkdir -p /export/Logs/servers/nginx/logs && mkdir -p /dev/shm/nginx_temp/client_body && nginx && sleep 9999999d
http-nginx.conf文件内容:
server { listen 80; server_name *.*.com; #日志地址 access_log /export/Logs/servers/nginx/logs/nginx_access.log main; error_log /export/Logs/servers/nginx/logs/nginx_error.log warn; #/路径对应的系统中的文件路径 root /opt/dist/; #默认首页 index index.html; #默认请求 location = / { index index.html; } #前置的重定向 # location = /index.html { # return 302 https://$host/print.html#/?skuId=$arg_skuId; # } #前置的重定向 # location = /indexV2 { # return 302 https://$host/print.html#/?skuId=$arg_defaultSkuId; # } #html界面 location ~ .*\.(?:htm|html)$ { #开启ssi 头尾系统需要 ssi on; ssi_last_modified on; add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; } #js css文件缓存 location ~ .*\.(?:js|css|woff|ttf)$ { #缓存1小时 expires 1h; } #图片 location ~ .*\.(?:jpg|jpeg|gif|ico|png|svg|webm)$ { expires 1h; } #头尾配置 location ^~ /print2/common/ { root /export/Data/jdos.jd.com/common/export/Data/; } #日志目录拦截 location /logs/ { #禁用所有ip请求该路径 deny all; } #默认配置 如果所有的location没有匹配则走该请求 location / { #禁用所有ip请求该路径 deny all; } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。