{"id":25,"date":"2024-08-14T21:20:08","date_gmt":"2024-08-15T03:20:08","guid":{"rendered":"https:\/\/wtech.ninja\/?p=25"},"modified":"2024-08-14T21:20:08","modified_gmt":"2024-08-15T03:20:08","slug":"my-wordpress-setup","status":"publish","type":"post","link":"https:\/\/wtech.ninja\/?p=25","title":{"rendered":"My wordpress setup"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I currently have wordpress running in docker, which I&#8217;ve been told is self-updating (dubious, but maybe).  And then am using nginx to reverse proxy it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is my docker-compose.yaml for anyone interested:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n\n  wordpress:\n    image: wordpress\n    restart: always\n    ports:\n      - 8083:80\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: wordie\n      WORDPRESS_DB_PASSWORD: NotMyRealPassword\n      WORDPRESS_DB_NAME: wordpress\n    volumes:\n      - wordpress:\/var\/www\/html\n\n  db:\n    image: mysql:8.0\n    restart: always\n    environment:\n      MYSQL_DATABASE: wordpress\n      MYSQL_USER: wordie\n      MYSQL_PASSWORD: NotMyRealPassword\n      MYSQL_RANDOM_ROOT_PASSWORD: '1'\n    volumes:\n      - db:\/var\/lib\/mysql\n\nvolumes:\n  wordpress:\n  db:<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And here is the relevant part of my nginx configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    if ($host = localhost:8080\/) {\n\treturn 301 https:\/\/$host$request_uri;\n    }\n\n    server_name localhost:8080\/;\n    listen 80;\n    listen [::]:80;\n    return 404;\n}\nserver {\n    server_name localhost:8080\/;\n    listen 443 ssl;\n    listen [::]:443 ssl;\n\n    ssl_certificate \/etc\/letsencrypt\/livelocalhost:8080\/fullchain.pem;\n    ssl_certificate_key \/etc\/letsencrypt\/livelocalhost:8080\/privkey.pem;\n    include \/etc\/letsencrypt\/options-ssl-nginx.conf;\n    ssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem;\n\n    location \/ {\n\tproxy_set_header Host $host;\n\tproxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_pass http:\/\/127.0.0.1:8083;\n\tproxy_redirect off;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Truth be told, some of those headers might not be needed. I just copied them from some other subdomains.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The more important thing to do is change your wordpress settings in Settings>General to point to the right domain. I wasted a few minutes figuring that out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, good luck and have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I currently have wordpress running in docker, which I&#8217;ve been told is self-updating (dubious, but maybe). And then am using nginx to reverse proxy it. This is my docker-compose.yaml for anyone interested: And here is the relevant part of my nginx configuration: Truth be told, some of those headers might not be needed. I just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-how-to"],"_links":{"self":[{"href":"https:\/\/wtech.ninja\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wtech.ninja\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wtech.ninja\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wtech.ninja\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wtech.ninja\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":0,"href":"https:\/\/wtech.ninja\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/wtech.ninja\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wtech.ninja\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wtech.ninja\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}