Trying to setup ghost at url Image optimization & performance - deliver faster websites & apps.
https://imagecompressor.io
- server 1
https://imagecompressor.io/blog
- Digital Ocean droplet (ex ip 159.65.193.48)
I have been successfully able to run ghost using 1-click on Digital Ocean. But not able to link it with the domain. I have gone through various articles, tried quite a few nginx configurations, can’t get it to work.
nginx config at imagecompressor.io
# Default server configuration
#
server {
root /var/www/imagecompressio-js/serve;
server_name imagecompressor.io;
location /images {
alias /var/www/images;
expires 1d;
add_header Cache-Control public;
add_header Content-disposition "attachment; filename=$1";
}
# ghost blog
location ^~ /blog {
proxy_pass http://159.65.193.48;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri /index.html =404;
expires -1;
}
location ~* \.(?:css|js)$ {
access_log off;
log_not_found off;
add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate";
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/imagecompressor.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/imagecompressor.io/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name api.imagecompressor.io;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/imagecompressor.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/imagecompressor.io/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = imagecompressor.io) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name imagecompressor.io;
return 404; # managed by Certbot
}
server {
if ($host = api.imagecompressor.io) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name api.imagecompressor.io;
return 404; # managed by Certbot
}
My first question is - what should the url be provided to ghost CLI while installing? http://159.65.193.48
or https://imagecompressor.io/blog
?
2nd - Are there any additional nginx configurations (or any other settings) that need to be tweaked on the Digital Ocean droplet?