{"id":28,"date":"2021-06-08T04:53:40","date_gmt":"2021-06-07T19:53:40","guid":{"rendered":"https:\/\/ohyou.hopto.org\/?p=28"},"modified":"2025-04-06T13:43:56","modified_gmt":"2025-04-06T04:43:56","slug":"nginx-%e3%83%aa%e3%83%90%e3%83%bc%e3%82%b9%e3%83%97%e3%83%ad%e3%82%ad%e3%82%b7-wordpress-%e7%ae%a1%e7%90%86%e7%94%bb%e9%9d%a2%e3%81%b8%e3%81%ae%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e5%88%b6%e9%99%90","status":"publish","type":"post","link":"https:\/\/ohyou.hopto.org\/?p=28","title":{"rendered":"Nginx \u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7 WordPress \u7ba1\u7406\u753b\u9762\u3078\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u5bfe\u8c61<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">WordPress \u306e\u7ba1\u7406\u753b\u9762\u306b IP\u30a2\u30c9\u30ec\u30b9\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u304b\u3051\u3001\u5916\u90e8\u516c\u958b\u3057\u305f\u304f\u306a\u3044\u3002<\/li>\n\n\n\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">WordPress docker \u30b3\u30f3\u30c6\u30ca\u306b Nginx docker \u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u63a5\u7d9a\u3057\u3066\u3044\u308b\u3002<\/li>\n\n\n\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">server \u3092\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u7f6e\u3044\u3066\u3044\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">WordPress \u3092\u5916\u90e8\u516c\u958b\u3057\u305f\u5834\u5408\u3001\/wp-login.php \u7b49\u306e\u7ba1\u7406\u753b\u9762\u3082\u516c\u958b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"562\" src=\"https:\/\/ohyou.hopto.org\/wp-content\/uploads\/2021\/06\/wp-login-1.jpeg\" alt=\"\" class=\"wp-image-30\" srcset=\"https:\/\/ohyou.hopto.org\/wp-content\/uploads\/2021\/06\/wp-login-1.jpeg 605w, https:\/\/ohyou.hopto.org\/wp-content\/uploads\/2021\/06\/wp-login-1-300x279.jpeg 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">\u3053\u306e\u753b\u9762\u306b IP\u30a2\u30c9\u30ec\u30b9\u306b\u3088\u308b\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u304b\u3089\u306e\u307f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">wordpress.conf<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen       ${NGINX_WP_PORT}; #\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u66f8\u304d\u63db\u3048\u308b\n    server_name  ${NGINX_WP_HOST}; #\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u66f8\u304d\u63db\u3048\u308b\n\n    access_log  \/var\/log\/nginx\/host.access.log  main;\n\n    location \/ {\n        location ~* \/wp-login\\.php|\/wp-admin\/((?!admin-ajax\\.php).)*$ {\n            allow 10.0.0.0\/8;\n            allow 172.16.0.0\/12;\n            allow 192.168.0.0\/16;\n            allow 127.0.0.1;\n            deny all;\n\n            proxy_pass http:\/\/wordpress;  # \u30b3\u30f3\u30c6\u30ca\u540d\u3092\u6307\u5b9a\n            proxy_redirect   off;\n            proxy_set_header Host               $host;\n            proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Host   $host;\n            proxy_set_header X-Forwarded-Server $host;\n            proxy_set_header X-Real-IP          $remote_addr;\n            proxy_set_header X-Forwarded-Proto  https;\n        }\n\n        proxy_pass http:\/\/wordpress;  # \u30b3\u30f3\u30c6\u30ca\u540d\u3092\u6307\u5b9a\n        proxy_redirect   off;\n        proxy_set_header Host               $host;\n        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Host   $host;\n        proxy_set_header X-Forwarded-Server $host;\n        proxy_set_header X-Real-IP          $remote_addr;\n        proxy_set_header X-Forwarded-Proto  https;\n    }<\/code><\/pre>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u5148\u3092\u6307\u5b9a\u3059\u308b &#8220;location \/ { }&#8221; \u306e\u4e2d\u306b\u3001\u7ba1\u7406\u753b\u9762\u95a2\u4fc2\u306e\u30a2\u30af\u30bb\u30b9\u5148\u3092\u6307\u5b9a\u3059\u308b &#8220;location ~* \/wp-login\\.php|\/wp-admin\/((?!admin-ajax\\.php).)*$ { }&#8221; \u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u5165\u308c\u5b50\u306b\u3059\u308b\u306e\u304c\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">&#8220;location ~* \/wp-login\\.php|\/wp-admin\/((?!admin-ajax\\.php).)*$ { }&#8221;\u306e\u5185\u5bb9\u306f\u3001\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">allow ~ \u306f\u3001\u30ed\u30fc\u30ab\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a31\u53ef\u3059\u308b\u8a18\u8ff0\u3067\u3059\u3002<\/li>\n\n\n\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">deny all \u306f\u3001allow \u3067\u8a31\u53ef\u3055\u308c\u305f\u30a2\u30c9\u30ec\u30b9\u4ee5\u5916\u3092\u3059\u3079\u3066\u62d2\u5426\u3059\u308b\u8a18\u8ff0\u3067\u3059\u3002<\/li>\n\n\n\n<li class=\"has-extra-small-font-size\" style=\"line-height:1.2\">IP\u30a2\u30c9\u30ec\u30b9\u5236\u9650\u306e\u90e8\u5206\u3060\u3051\u3060\u3068\u3001\u5236\u5fa1\u3092\u3057\u305f\u3042\u3068\u3069\u3053\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u63a5\u7d9a\u5148\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">proxy ~ \u306e\u5185\u5bb9\u306f\u3001\u3072\u3068\u3064\u76ee\u306e\u584a\u306e\u5185\u5bb9\u3068\u3075\u305f\u3064\u76ee\u3067\u5168\u304f\u540c\u3058\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">\u30e1\u30a4\u30f3\u306e\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7 location \u4e2d\u306b\u6761\u4ef6\u6307\u5b9a\u306e location \u3092\u5165\u308c\u3001\u305d\u3053\u306b\u30a2\u30c9\u30ec\u30b9\u5236\u9650\u3068\u30a2\u30af\u30bb\u30b9\u5148\u3092\u8a18\u8ff0\u3059\u308b\u3068\u3044\u3046\u69cb\u9020\u3067\u3059\u3002\u3075\u305f\u3064\u306e location \u3092\u5165\u308c\u5b50\u306b\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3084 allow \u3068 deny \u3060\u3051\u8a18\u8ff0\u3057\u3066\u305d\u306e\u3042\u3068\u306e\u30a2\u30af\u30bb\u30b9\u5148\u3092\u66f8\u3044\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u671f\u5f85\u901a\u308a\u306e\u6319\u52d5\u306b\u306a\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5916\u90e8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9<\/h2>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">\u4e0a\u8a18\u8a2d\u5b9a\u3092\u305d\u306e\u307e\u307e\u9069\u7528\u3057\u305f\u5834\u5408\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u306f\u7ba1\u7406\u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u305a\u3001 server \u3068\u540c\u3058 LAN \u5185\u304b\u3089\u306a\u3089\u7ba1\u7406\u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u3082\u3057\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u8d8a\u3057\u306b\u7ba1\u7406\u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3044\u5834\u5408\u306f\u3001LAN \u5185\u306b VPN \u30b5\u30fc\u30d0\u30fc\u3092\u7528\u610f\u3057\u3066 VPN \u63a5\u7d9a\u3059\u308c\u3070\u826f\u3044\u3067\u3059\u3002LAN \u5185\u306e VPN \u30b5\u30fc\u30d0\u3092\u7d4c\u7531\u3057\u305f\u5834\u5408\u3001Nginx \u304b\u3089\u306f LAN \u5185\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3068\u3057\u3066\u304d\u3066\u3044\u308b\u3068\u6271\u308f\u308c\u308b\u305f\u3081\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u7d4c\u7531\u3067\u3082\u7ba1\u7406\u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p class=\"has-extra-small-font-size wp-block-paragraph\">Nginx \u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3092\u7528\u3044\u305f WordPress \u5916\u90e8\u516c\u958b\u307e\u3067\u306e\u624b\u9806\u306f\u3001\u3053\u3061\u3089\u306e\u8a18\u4e8b\u304c\u5927\u5909\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<br><a href=\"https:\/\/qiita.com\/daemokra\/items\/7fa67c23c15f3353b2a8\">Docker\u3067\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7(nginx)\u69cb\u7bc9+SSL\u5bfe\u5fdc &#8211; Qiita<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfe\u8c61 WordPress \u3092\u5916\u90e8\u516c\u958b\u3057\u305f\u5834\u5408\u3001\/wp-login.php \u7b49\u306e\u7ba1\u7406\u753b\u9762\u3082\u516c\u958b\u3055\u308c\u307e\u3059\u3002 \u3053\u306e\u753b\u9762\u306b IP\u30a2\u30c9\u30ec\u30b9\u306b\u3088\u308b\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u304b\u3089\u306e\u307f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002 &hellip; <a class=\"more-link\" href=\"https:\/\/ohyou.hopto.org\/?p=28\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Nginx \u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7 WordPress \u7ba1\u7406\u753b\u9762\u3078\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[7,11,13,8,15,9,14,10],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-server","tag-docker","tag-ip","tag-location","tag-nginx","tag-nginx-conf","tag-wordpress","tag-14","tag-10","entry"],"_links":{"self":[{"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":9,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ohyou.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}