{"id":1016,"date":"2010-07-17T18:10:45","date_gmt":"2010-07-17T09:10:45","guid":{"rendered":"http:\/\/ecpplus.net\/weblog\/?p=1016"},"modified":"2020-06-15T22:42:35","modified_gmt":"2020-06-15T13:42:35","slug":"switch-schema-by-url-on-nginx","status":"publish","type":"post","link":"https:\/\/ecpplus.net\/weblog\/switch-schema-by-url-on-nginx\/","title":{"rendered":"nginx\u3067 \u7279\u5b9a\u30da\u30fc\u30b8\u3060\u3051https\u306b\u632f\u308a\u5206\u3051\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3084\u7ba1\u7406\u753b\u9762\u306a\u3069\u3001\u30bb\u30ad\u30e5\u30a2\u306b\u3057\u305f\u3044\u30da\u30fc\u30b8\u306b\u3060\u3051SSL\u3092\u304b\u3051\u308b\u3002\u3068\u3044\u3046\u306e\u3092 nginx \u3067\u3084\u308b\u65b9\u6cd5\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\/admin \u4ee5\u4e0b\u3001 \/login \u4ee5\u4e0b\u3092SSL\u306b\u3057\u3066\u3001\u305d\u308c\u610f\u5916\u306e\u30da\u30fc\u30b8\u306f\u975eSSL\u306b\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002\u7d30\u304b\u3044\u8a2d\u5b9a\u306f\u7aef\u6298\u3063\u3066\u3001<code>upstream appserver<\/code> \u3067\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u30b5\u30fc\u30d0\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u308b\u3068\u304d\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-nginx line-numbers\">    # HTTP setting\n    server {\n        listen       80;\n        server_name  localhost;\n\n        location ~ ^\/(admin|login) {\n            rewrite ^(.*) https:\/\/$http_host$1;\n            break;\n        }\n\n        location \/ {\n            proxy_pass http:\/\/appserver;\n        }\n    }\n\n    # HTTPS setting\n    server {\n        listen       443;\n        server_name  localhost;\n\n        ssl                  on;\n        ssl_certificate      server.pem;\n        ssl_certificate_key  server.key;\n        ssl_session_timeout  5m;\n\n        ssl_protocols  SSLv2 SSLv3 TLSv1;\n        ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;\n        ssl_prefer_server_ciphers   on;\n\n        location ~ ^\/(admin|login) {\n            proxy_pass http:\/\/appserver;\n            break;\n        }\n\n        location \/ {\n            rewrite ^(.*) http:\/\/$http_host$1;\n        }\n    }\n<\/code><\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u306b\u3059\u308b\u3068\u3001http:\/\/host\/login \u3068\u304b\u3067\u30a2\u30af\u30bb\u30b9\u304c\u6765\u308b\u3068\u3001 https:\/\/host\/login \u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u307e\u3059\u3002\u9006\u306b\u3001 https:\/\/host\/top \u3067\u30a2\u30af\u30bb\u30b9\u304c\u6765\u308b\u3068\u3001http:\/\/host\/top \u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><code>break;<\/code> \u3068\u66f8\u304f\u3068\u3001\u305d\u308c\u4ee5\u964d\u306e\u30de\u30c3\u30c1\u30f3\u30b0\u306f\u884c\u308f\u308c\u306a\u3044\u306e\u3067\u3001\u66f8\u3044\u3066\u304a\u304f\u3068\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3084\u7ba1\u7406\u753b\u9762\u306a\u3069\u3001\u30bb\u30ad\u30e5\u30a2\u306b\u3057\u305f\u3044\u30da\u30fc\u30b8\u306b\u3060\u3051SSL\u3092\u304b\u3051\u308b\u3002\u3068\u3044\u3046\u306e\u3092 nginx \u3067\u3084\u308b\u65b9\u6cd5\u3002 \u305f\u3068\u3048\u3070\u3001\/admin \u4ee5\u4e0b\u3001 \/login \u4ee5\u4e0b\u3092SSL\u306b\u3057\u3066\u3001\u305d\u308c\u610f\u5916\u306e\u30da\u30fc\u30b8\u306f\u975eSSL\u306b\u3057\u305f\u3044\u5834\u5408\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[7,20],"class_list":["post-1016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-linux","tag-nginx"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/comments?post=1016"}],"version-history":[{"count":4,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":2708,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/1016\/revisions\/2708"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media\/2702"}],"wp:attachment":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media?parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/categories?post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/tags?post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}