{"id":1284,"date":"2017-04-13T12:29:27","date_gmt":"2017-04-13T03:29:27","guid":{"rendered":"https:\/\/www.rocher.kyoto.jp\/arbr\/?p=1284"},"modified":"2017-04-14T12:30:50","modified_gmt":"2017-04-14T03:30:50","slug":"%e5%8f%96%e3%82%8a%e6%80%a5%e3%81%8e%e3%81%ae%e3%83%a1%e3%83%b3%e3%83%86%e3%83%8a%e3%83%b3%e3%82%b9%e7%94%bb%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/www.rocher.kyoto.jp\/arbr\/?p=1284","title":{"rendered":"\u53d6\u308a\u6025\u304e\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u753b\u9762"},"content":{"rendered":"<h2>\u524d\u63d0<\/h2>\n<p>\u524d\u306e\u696d\u8005\u304c\u5b8c\u6210\u305b\u305a\u306b\u4e2d\u9014\u534a\u7aef\u306b\u672c\u756a\u74b0\u5883\u306b\u306e\u3063\u3066\u3044\u308bECCube\u3001\u8a8d\u8a3c\u3082\u304b\u3051\u305a\u306b\u653e\u7f6e\u3057\u3066\u3044\u305f\u3089\u30d7\u30ec\u30b9\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u305f\u95a2\u4fc2\u304bURL\u76f4\u6253\u3061\u3067\u3082\u306e\u304c\u58f2\u308c\u3066\u3057\u307e\u3063\u305f\u3068\u3055\u3002\u3002<br \/>\n\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u614c\u3066\u3066\u4e00\u822c\u306e\u4eba\u306f\u898b\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u307b\u3057\u3044\u3068\u306e\u96fb\u8a71\u304c\u3002<br \/>\n\u3067\u3082\u3001\u6b21\u306e\u696d\u8005\u306f\u7269\u3092\u898b\u3066\u307b\u3057\u3044\u306e\u3067\u696d\u8005\u306f\u898b\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u307b\u3057\u3044\u3068\u3002<\/p>\n<p>\u8272\u3005\u7a81\u3063\u8fbc\u307f\u3069\u3053\u308d\u306f\u3042\u308b\u3051\u308c\u3069\u3082\u53d6\u308a\u6025\u304e\u6e80\u305f\u3055\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044(?)\u8981\u4ef6\u306f<br \/>\n\u30fb\u4e00\u822c\u306e\u4eba\u304c\u898b\u308b\u3068\u300c\u307e\u3060OPEN\u3057\u3066\u307e\u305b\u3093\u3088\u300d\u306b\u98db\u3070\u3059<br \/>\n\u30fb\u696d\u8005\u306f\u3082\u306e\u3092\u898b\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3002<br \/>\n\u30fb\u89e6\u308b\u3068\u8272\u3005\u5dfb\u304d\u8fbc\u307e\u308c\u305d\u3046\u306a\u306e\u3067\u3067\u304d\u308b\u3060\u3051\u4eca\u3042\u308b\u3082\u306e\u306b\u306f\u624b\u3092\u52a0\u3048\u305f\u304f\u306a\u3044<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u8a8d\u8a3c\u4ed8\u304d\u306e\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3092\u7d4c\u7531\u3057\u3066\u8a8d\u8a3c\u3057\u3066\u3044\u306a\u3044\u4eba\u306f\u544a\u77e5\u753b\u9762\u306b\u98db\u3070\u3059\u3053\u3068\u306b\u3059\u308b\u3002<br \/>\n\u696d\u8005\u3055\u3093\u304c\u898b\u308b\u76ee\u7684\u306a\u306e\u3067SSL\u8a3c\u660e\u66f8\u306f\u305d\u306e\u307e\u307e\u3067http\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082\u3089\u3048\u3070\u65e2\u5b58web\u30b5\u30fc\u30d0\u306eport\u756a\u53f7\u3092\u5909\u3048\u308b\u3060\u3051\u3067\u65e2\u5b58\u306e\u3082\u306e\u306b\u306f\u5f71\u97ff\u3067\u306a\u3044\u3064\u3082\u308a\u3002<br \/>\n\u30d7\u30ed\u30ad\u30b7\u306f\u8a8d\u8a3c\u51e6\u7406\u3042\u308b\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u8003\u3048\u308b\u3068docker\u306eopenresty\u3067\u4f5c\u308b\u306e\u304c\u3088\u3055\u305d\u3046\u304b\u306a\u3002<br \/>\n\u540c\u4e00\u30db\u30b9\u30c8\u4e0a\u306b\u3042\u308b\u306e\u3067\u6c7a\u88c1\u30e2\u30b8\u30e5\u30fc\u30eb\u7b49\u3082\u304d\u3063\u3068\u52d5\u3044\u3066\u304f\u308c\u308b\u3060\u308d\u3046\u3002<\/p>\n<p>\u3068\u3044\u3046\u65b9\u91dd\u3067\u4f5c\u696d\u958b\u59cb\u3002<\/p>\n<h2><\/h2>\n<h2>\u8a66\u9a13\u6a5f\u3067<\/h2>\n<h3>nginx\u5468\u308a<\/h3>\n<p>\u672c\u756a\u6a5f\u306fCentOS7.2\u3002<br \/>\nport\u3084\u3089\u3084\u3089\u89e6\u308b\u306e\u3067\u30b0\u30eb\u30fc\u30d0\u30ebIP\u3042\u308b\u3084\u3064\u3067\u3084\u3089\u3093\u3068\u6df7\u4e71\u3057\u305d\u3046\u3002<br \/>\n\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u6a5f\u306b\u306a\u308b\u4e88\u5b9a\u3067\u5951\u7d04\u3060\u3051\u3057\u3066\u3044\u308b\u3055\u304f\u3089VPS\u306bOS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u304b\u3089\u306f\u3044\u308b\u3002<\/p>\n<pre class=\"code lang-zsh\" data-lang=\"zsh\" data-unlink=\"\">yum -y install docker\r\nsystemctl start docker\r\nsystemctl enable docker\r\n<del>docker pull openresty\/openresty<\/del>\r\ndocker run -d -p 80:80 --name proxy openresty\/openresty<span style=\"color: #ff0000;\">:trusty\r\n<\/span><\/pre>\n<p>\u304d\u3063\u3068\u516c\u5f0f\u3063\u307d\u3044openresty\u306e\u30a4\u30e1\u30fc\u30b8\u3002\u6700\u521d\u30bf\u30b0\u7121\u3057(latest)\u3067pull\u3057\u305f\u3051\u308c\u3069\u3082<a href=\"https:\/\/hub.docker.com\/r\/openresty\/openresty\/\">Usage<\/a>\u306b\u306fopenresty\/openresty:trusty\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u3053\u3063\u3061\u3092\u5229\u7528\u3002<\/p>\n<p>\u3053\u3053\u3067\u30b5\u30fc\u30d0\u306eIP\u3067http\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u8d77\u52d5\u306f\u3057\u3066\u3044\u308b\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u4e2d\u306b\u5165\u3063\u3066\u78ba\u8a8d\u3002<\/p>\n<pre>docker exec -it proxy \/bin\/bash<\/pre>\n<p>\u591a\u5206\u3001\/usr\/local\/openresty\/nginx\/conf\/nginx.conf<br \/>\n\u3060\u3051\u3044\u3058\u308c\u3070\u5927\u4e08\u592b\u305d\u3046\u3002\u305d\u306e\u307e\u307e\u3044\u3058\u3063\u3066\u3082\u3044\u3044\u3051\u3069\u3001\u5165\u3063\u3066\u3044\u308b\u30a8\u30c7\u30a3\u30bf\u304cvim\u3067\u306a\u304fvi\u3067\u5acc\u3044\u306a\u306e\u3067\u30b3\u30d4\u30fc<\/p>\n<pre>docker cp proxy:\/usr\/local\/openresty\/nginx\/conf\/nginx.conf nginx.conf\r\nvi nginx.conf<\/pre>\n<p>\u4e2d\u8eab\u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n<pre>    server {\r\n        listen       80;\r\n        server_name  localhost;\r\n\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header Host $http_host;\r\n        proxy_redirect off;\r\n\r\n        #charset koi8-r;\r\n\r\n        #access_log  logs\/host.access.log  main;\r\n        location \/auth.html {\r\n          access_by_lua_block{\r\n            ngx.header['Set-Cookie'] = 'gyousya=desu; path=\/'\r\n          }\r\n          root   html;\r\n        }\r\n\r\n        location \/kokuchi.pdf {\r\n          root   html;\r\n        }\r\n\r\n        location \/ {\r\n            root   html;\r\n\r\n            rewrite_by_lua_block{\r\n              local cookie_val = ngx.var.cookie_gyousya\r\n              if (not cookie_val) then\r\n                return ngx.redirect(\"https:\/\/www.rocher.kyoto.jp\/\")\r\n              end\r\n            }\r\n            proxy_pass http:\/\/49.212.208.218:8081;\r\n        }<\/pre>\n<p>location \/auth.html\u306b\u6765\u305f\u6642\u306b\u30af\u30c3\u30ad\u30fc\u30bb\u30c3\u30c8\u3057\u3066<br \/>\nlocation \/\u3000\u3067\u30af\u30c3\u30ad\u30fc\u304cNil\u3060\u3068\u3088\u305d\u306b\u98db\u3070\u3059\u3002<br \/>\n\u672c\u6765\u3060\u3068kokuchi.pdf\u306b\u98db\u3070\u3059\u3051\u3069\u544a\u77e5\u5206\u307e\u3060\u3067\u304d\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u81ea\u5206\u306e\u5e97\u306b\u3002<\/p>\n<p>\u4e0a\u306e\u65b9\u306eproxy_set_header\u7cfb\u306f\u5f8c\u308d\u306b\u3042\u308bapache\u304c\u30ea\u30e2\u30fc\u30c8\u30a2\u30c9\u30ec\u30b9\u62fe\u3048\u308b\u3088\u3046\u306b\u3002<\/p>\n<p>proxy_pass\u306fhost\u306e\u30b0\u30ed\u30fc\u30d0\u30ebIP\u76f4\u63a5\u6307\u5b9a\u3002<\/p>\n<pre>docker cp nginx.conf proxy:\/usr\/local\/openresty\/nginx\/conf\/nginx.conf<\/pre>\n<p>\u30b3\u30f3\u30c6\u30ca\u306b\u30b3\u30d4\u30fc\u3002\u30b3\u30f3\u30c6\u30ca\u3078\u306e\u30b3\u30d4\u30fc\u3082\u4eca\u306f\u3067\u304d\u308b\u306e\u306d\u3002\u3002<\/p>\n<h3>apache<\/h3>\n<p>apache\u306e\u8a2d\u5b9a\u3082\u4e00\u5fdc\u3002<a href=\"http:\/\/doc.ec-cube.net\/quickstart_proxy\">ECCube\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u30c1\u30e9\u898b\u3057\u305f\u611f\u3058\u3060\u3068\u5fc5\u8981\u306a\u3055\u305d\u3046\u306a\u6c17\u3082\u3059\u308b\u3051\u3069\u5143\u306eIP\u3082apache\u672c\u4f53\u3067\u3082\u3002\u5b9f\u969b\u306b\u306fheader\u306bX-Forwarded-For\u7cfb\u304c\u3064\u3044\u3066\u3044\u308c\u3070\u5927\u4e08\u592b\u305d\u3046\u3002<\/p>\n<pre>#httpd -M | grep remoteip\r\n remoteip_module (shared)\r\n<\/pre>\n<p>yum\u3067\u53d6\u308a\u3042\u3048\u305a\u5165\u308c\u305f\u3084\u3064\u3060\u3051\u3069mod_remoteip\u5165\u3063\u3066\u3044\u308b\u3002<br \/>\n\u672c\u756a\u6a5f\u3082yum(chef\u3067package install)\u3067\u3084\u3063\u3066\u3044\u308b\u306e\u3067\u304d\u3063\u3068\u5165\u3063\u3066\u3044\u308b\u306f\u305a\u3002\uff08\u672a\u78ba\u8a8d\uff09<\/p>\n<p><a href=\"https:\/\/blog.yskw.info\/articles\/256\/\">\u3053\u3061\u3089<\/a>\u53c2\u8003\u306b\u8a2d\u5b9a\u3002<\/p>\n<p>SSL\u6b62\u3081\u3066\u306a\u3044\u3051\u3069\u660e\u65e5\u3002<br \/>\nEC-Cube\u306e\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u306a\u3044\u3051\u3069\u3001\u672c\u756a\u6a5f\uff08\u3068\u3044\u3046\u540d\u306e\u6b8b\u9ab8\uff09\u306b\u660e\u65e5\u306f\u76f4\u63a5\u8a2d\u5b9a\u3002<br \/>\n\u52d5\u4f5c\u78ba\u8a8d\u306f\u5143\u3005\u52d5\u3044\u3066\u3044\u306a\u3044\u306e\u3067\u96e3\u3057\u3044\u304b\u306a\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u63d0 \u524d\u306e\u696d\u8005\u304c\u5b8c\u6210\u305b\u305a\u306b\u4e2d\u9014\u534a\u7aef\u306b\u672c\u756a\u74b0\u5883\u306b\u306e\u3063\u3066\u3044\u308bECCube\u3001\u8a8d\u8a3c\u3082\u304b\u3051\u305a\u306b\u653e\u7f6e\u3057\u3066\u3044\u305f\u3089\u30d7\u30ec\u30b9\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u305f\u95a2\u4fc2\u304bURL\u76f4\u6253\u3061\u3067\u3082\u306e\u304c\u58f2\u308c\u3066\u3057\u307e\u3063\u305f\u3068\u3055\u3002\u3002 \u3068\u3044\u3046\u308f\u3051\u3067\u3001\u614c\u3066\u3066\u4e00\u822c\u306e\u4eba\u306f\u898b\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u307b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[92,93],"class_list":["post-1284","post","type-post","status-publish","format-standard","hentry","category-58","tag-docker","tag-nginx"],"_links":{"self":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1284"}],"version-history":[{"count":8,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1284\/revisions"}],"predecessor-version":[{"id":1292,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1284\/revisions\/1292"}],"wp:attachment":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}