Skip to content
Snippets Groups Projects
Select Git revision
  • fd9f68064c11fffd5cfd4843f218d42c3ab10762
  • main default protected
2 results

ipfs-rpc.nginx.conf

Blame
  • ipfs-rpc.nginx.conf 1.08 KiB
    # replace the following: 
    # RPC_KUBO_DOMAIN = the name under which expose your RPC API
    # RPC_KUBO_PORT = the rpc api port (ususally 5001 or 6001)
    
    server {
      listen 80 ;
      listen [::]:80 ;
    
      server_name RPC_KUBO_DOMAIN;
      return 301 https://$host$request_uri;
    }
    
    server {
      listen 443 ssl;
      listen [::]:443 ssl;
    
      ssl_certificate /etc/letsencrypt/live/RPC_KUBO_DOMAIN/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/RPC_KUBO_DOMAIN/privkey.pem;
    
      server_name RPC_KUBO_DOMAIN;
    
      access_log /var/log/nginx/RPC_KUBO_DOMAIN_access.log;
      error_log /var/log/nginx/RPC_KUBO_DOMAIN_error.log;
    
      # main location
      location / {
        return 400;
      }
      location /api/v0/file/ {
        proxy_pass http://localhost:RPC_KUBO_PORT;
        proxy_set_header Host $host;
      }
      location /api/v0/dag/ {
        proxy_pass http://localhost:RPC_KUBO_PORT;
        proxy_set_header Host $host;
      }
      location /api/v0/block/ {
        proxy_pass http://localhost:RPC_KUBO_PORT;
        proxy_set_header Host $host;
      }
      location /api/v0/pubsub/ {
        proxy_pass http://localhost:RPC_KUBO_PORT;
        proxy_set_header Host $host;
      }
    }