we have request client need host wordpress site within our website. within, mean site can't sit in subdomain, i.e https://blog.example.com, instead needs sit in own route/subfolder, i.e. https://www.example.com/blog. due page ranking (apparently page rankings penalised if put in subdomains)
the issue is, our site isn't run in php (its written in scala runs on jetty). furthermore, our main site run docker container backed nginx.
ideally want host wordpress on own single server (either docker containerized or not, not huge issue), , in nginx configuration our main site, have reverse external server specific url (i.e. https://www.example.com/blog point ip/host of external server running wordpress)
how achieve this/is possible? current nginx.conf our main server
server { listen 80; listen [::]:80; listen 443 default_server ssl; server_name www.example.com.au; ssl_certificate /etc/nginx/cert.crt; ssl_certificate_key /etc/nginx/cert.key; ssl_session_cache shared:ssl:1m; ssl_session_timeout 5m; ssl_protocols tlsv1 tlsv1.1 tlsv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "eecdh+ecdsa+aesgcm:eecdh+arsa+aesgcm:eecdh+ecdsa+sha256:eecdh+arsa+sha256:eecdh+ecdsa+sha384:eecdh+ecdsa+sha256:eecdh+arsa+sha384:edh+arsa+aesgcm:edh+arsa+sha256:edh+arsa:eecdh:!anull:!enull:!medium:!low:!3des:!md5:!exp:!psk:!srp:!dss:!rc4:!seed"; add_header strict-transport-security "max-age=31536000; includesubdomains"; if ($scheme = http) { return 301 https://$server_name$request_uri; } location / { proxy_pass http://localhost:8080; proxy_redirect http://www.example.com.au /; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $remote_addr; proxy_read_timeout 600s; port_in_redirect off; } } this example of our current nginx.conf, can see, actual website being hosted on localhost:8080 , proxy redirect main site.
assume wordpress service hosted in http://localhost:8081, can proxy_pass /blog requests http://localhost:8081, can add following block nginx server block:
location ^~ /blog { proxy_pass http://localhost:8081; }
Comments
Post a Comment