Skip to content

Instantly share code, notes, and snippets.

@bussyjd
Created September 17, 2019 11:50
Show Gist options
  • Save bussyjd/fe08d3659250e89a63aba314e1067a76 to your computer and use it in GitHub Desktop.
Save bussyjd/fe08d3659250e89a63aba314e1067a76 to your computer and use it in GitHub Desktop.
Nginx.conf config file
server {
server_name <your ipfs domain name>; # managed by Certbot
location /api/v0/add {
proxy_pass http://localhost:5001;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
allow all;
}
location /ipfs {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
allow all;
}
location / {
proxy_pass http://localhost:5001;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
deny all; # <- Deny other traffic
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ipfs.dsla.network/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ipfs.dsla.network/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 = <your ipfs domain name> ) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name <your ipfs domain name>;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment