HydroProtocol / hydro-scaffold-dex

A Decentralized Exchange Scaffold - launch a DEX in minutes
Apache License 2.0
196 stars 189 forks source link

How to configure for external access? (somehow i couldn't do it) #64

Closed lxradda closed 4 years ago

lxradda commented 4 years ago

I had no problems when I tried with Localhost. I followed the instructions and I'm making a mistake somewhere.

- REACT_APP_API_URL=http://api.theexchange.site - REACT_APP_WS_URL=wss://ws.theexchange.site - REACT_APP_NODE_URL=http://rpc.theexchange.site I edited the nginx-config.md folder

upstream hydro-dex-web {
    server theexchange.site;
}

upstream hydro-dex-api {
    server theexchange.site;
}

upstream hydro-dex-ws {
    server theexchange.site;
}

 upstream hydro-dex-rpc {
     server theexchange.site;
 }

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;
proxy_set_header X-Forwarded-Proto $scheme;

server {
    listen 80;
    server_name theexchange.site;

    # cache static content
    location ^~ /static/ {
        expires    7d;
        proxy_pass http://hydro-dex-web;
    }

    location / {
        proxy_pass http://hydro-dex-web;
    }
}

server {
    listen 80;
    server_name api.theexchange.site;
    location / {
        proxy_pass http://hydro-dex-api;
    }
}

server {
    listen 80;
    server_name ws.theexchange.site;
    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://hydro-dex-ws;
    }
}

server {
     listen 80;
     server_name rpc.theexchange.site;
     location / {
         proxy_pass http://hydro-dex-rpc;
     }
 }

sudo nginx -t and sudo nginx -s reload

does not work when I go to the my web site .

where am i doing wrong?

thanks

NEO2756 commented 4 years ago

server in upstream should point to your local server. Pls refer https://github.com/HydroProtocol/hydro-scaffold-dex/blob/master/manual/config-nginx.md

upstream hydro-dex-web { server localhost:3000; //theexchange.site; }

davidqhr commented 4 years ago

Thanks @NEO2756.