{"id":1963,"date":"2018-09-18T12:15:27","date_gmt":"2018-09-18T11:15:27","guid":{"rendered":"https:\/\/www.thenaylors.co.uk\/wordpress\/?p=1963"},"modified":"2018-10-29T13:46:23","modified_gmt":"2018-10-29T13:46:23","slug":"omv-wordpress-and-nginx-a-further-update","status":"publish","type":"post","link":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/","title":{"rendered":"OMV &#8211; WordPress and NGINX &#8211; a further update"},"content":{"rendered":"<p>I was struggling with WordPress and permalinks.&nbsp; The prior onfiguration I had developed worked fine until I switched to permalinks and then it seems to be picked up the js css etc from the root and not the alias.<\/p>\n<p>Google is wonderful as I found this site &#8211; <a href=\"http:\/\/www.netz39.de\/2014\/installation-of-wordpress-in-a-subdirectory-with-nginx\/\">http:\/\/www.netz39.de\/2014\/installation-of-wordpress-in-a-subdirectory-with-nginx\/<\/a>.<\/p>\n<p>I thought it was something to do with the way the try_files was working in relation to fastcgi.&nbsp; It was.<\/p>\n<p>So the wordpress config was update to be as below.&nbsp; Note the location rewrite needs to be at the server level.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nlocation @wordpress_rewrite {\nrewrite ^\/wordpress\/(.*)$ \/wordpress\/index.php?$1;\n}\n\nlocation \/wordpress {\nalias \/media\/13eaa8c9-07ee-4dfc-9d1b-adfae0f0248d\/www\/wordpress;\n\nadd_header Content-Security-Policy &quot;default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';&quot; always;\nadd_header X-Content-Type-Options nosniff;\nadd_header X-XSS-Protection &quot;1; mode=block&quot;;\nadd_header X-Robots-Tag none;\nadd_header X-Download-Options noopen;\nadd_header X-Permitted-Cross-Domain-Policies none;\n\nindex index.php;\ntry_files $uri $uri\/ @wordpress_rewrite;\n\nlocation ~* \/wordpress\/(?:uploads|files)\/.*\\.php$ {\ndeny all;\n}\n\nlocation ~ ^\/wordpress\/(.+\\.php)$ {\nalias                           \/media\/13eaa8c9-07ee-4dfc-9d1b-adfae0f0248d\/www\/wordpress\/$1;\nfastcgi_split_path_info         ^(.+\\.php)(\/.*)$;\ninclude fastcgi.conf;\nfastcgi_index index.php;\nfastcgi_param SCRIPT_FILENAME $request_filename;\nfastcgi_pass unix:\/var\/run\/fpm-19e311b1-25e1-4257-8dbc-d49c5ec59015.sock;\n}\n\nlocation = \/wordpress\/favicon.ico {\naccess_log off;\nlog_not_found off;\n}\n\nlocation = \/wordpress\/robots.txt {\nallow all;\naccess_log off;\nlog_not_found off;\n}\n\nlocation ~ \/wordpress\/\\. {\ndeny all;\n}\n\nlocation ~* \/wordpress\/(?:config)\/.*\\.php$ {\ndeny all;\n}\n\nlocation ~* \/wordpress\/\\.(js|css|png|jpg|jpeg|gif|ico)$ {\nexpires max;\nlog_not_found off;\n}\n}\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was struggling with WordPress and permalinks.&nbsp; The prior onfiguration I had developed worked fine until I switched to permalinks and then it seems to be picked up the js css etc from the root and not the alias. Google is wonderful as I found this site &#8211; http:\/\/www.netz39.de\/2014\/installation-of-wordpress-in-a-subdirectory-with-nginx\/. I thought it was something to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OMV &#8211; WordPress and NGINX &#8211; a further update&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[173,4],"tags":[],"class_list":["post-1963","post","type-post","status-publish","format-standard","hentry","category-nginx","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OMV - Wordpress and NGINX - a further update - Michael Naylor<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OMV - Wordpress and NGINX - a further update - Michael Naylor\" \/>\n<meta property=\"og:description\" content=\"I was struggling with WordPress and permalinks.&nbsp; The prior onfiguration I had developed worked fine until I switched to permalinks and then it seems to be picked up the js css etc from the root and not the alias. Google is wonderful as I found this site &#8211; http:\/\/www.netz39.de\/2014\/installation-of-wordpress-in-a-subdirectory-with-nginx\/. I thought it was something to &hellip; Continue reading &quot;OMV &#8211; WordPress and NGINX &#8211; a further update&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\" \/>\n<meta property=\"og:site_name\" content=\"Michael Naylor\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-18T11:15:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-29T13:46:23+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:site\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad\"},\"headline\":\"OMV &#8211; WordPress and NGINX &#8211; a further update\",\"datePublished\":\"2018-09-18T11:15:27+00:00\",\"dateModified\":\"2018-10-29T13:46:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\"},\"wordCount\":283,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"articleSection\":[\"NGINX\",\"Wordpress\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\",\"name\":\"OMV - Wordpress and NGINX - a further update - Michael Naylor\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\"},\"datePublished\":\"2018-09-18T11:15:27+00:00\",\"dateModified\":\"2018-10-29T13:46:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OMV &#8211; WordPress and NGINX &#8211; a further update\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\",\"name\":\"Michael Naylor\",\"description\":\"Things which interest me.\",\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\",\"name\":\"Michael Naylor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"caption\":\"Michael Naylor\"},\"logo\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.thenaylors.co.uk\/wordpress\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OMV - Wordpress and NGINX - a further update - Michael Naylor","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/","og_locale":"en_GB","og_type":"article","og_title":"OMV - Wordpress and NGINX - a further update - Michael Naylor","og_description":"I was struggling with WordPress and permalinks.&nbsp; The prior onfiguration I had developed worked fine until I switched to permalinks and then it seems to be picked up the js css etc from the root and not the alias. Google is wonderful as I found this site &#8211; http:\/\/www.netz39.de\/2014\/installation-of-wordpress-in-a-subdirectory-with-nginx\/. I thought it was something to &hellip; Continue reading \"OMV &#8211; WordPress and NGINX &#8211; a further update\"","og_url":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/","og_site_name":"Michael Naylor","article_published_time":"2018-09-18T11:15:27+00:00","article_modified_time":"2018-10-29T13:46:23+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@mjnaylor","twitter_site":"@mjnaylor","twitter_misc":{"Written by":"admin","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#article","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/"},"author":{"name":"admin","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad"},"headline":"OMV &#8211; WordPress and NGINX &#8211; a further update","datePublished":"2018-09-18T11:15:27+00:00","dateModified":"2018-10-29T13:46:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/"},"wordCount":283,"commentCount":0,"publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"articleSection":["NGINX","Wordpress"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/","name":"OMV - Wordpress and NGINX - a further update - Michael Naylor","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website"},"datePublished":"2018-09-18T11:15:27+00:00","dateModified":"2018-10-29T13:46:23+00:00","breadcrumb":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/omv-wordpress-and-nginx-a-further-update\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thenaylors.co.uk\/wordpress\/"},{"@type":"ListItem","position":2,"name":"OMV &#8211; WordPress and NGINX &#8211; a further update"}]},{"@type":"WebSite","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/","name":"Michael Naylor","description":"Things which interest me.","publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5","name":"Michael Naylor","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","caption":"Michael Naylor"},"logo":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.thenaylors.co.uk\/wordpress"]},{"@type":"Person","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=1963"}],"version-history":[{"count":6,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1963\/revisions"}],"predecessor-version":[{"id":2010,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1963\/revisions\/2010"}],"wp:attachment":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=1963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=1963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=1963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}