CausticLab / rgon-proxy

the base image of the rancher nginx-letsencrypt proxy
5 stars 1 forks source link

Modify nginx.conf #53

Closed sindile closed 6 years ago

sindile commented 6 years ago

I am trying to figure out how can I bring the following configuration information into rgon-proxy

server { server_name mydomain.com;

client_max_body_size 150M;

location ~ /(user/./)?api/v1/maps { proxy_set_header Host $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; proxy_pass http://127.0.0.1:3000; }

location ~ /(user/./)?api/v1/map { proxy_set_header Host $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; proxy_pass http://127.0.0.1:8181; }

location ~ /(user/.)?/api/v2/sql {

RedHog: Hack to work around bug in cartodb local hosting but using cdn for js libs

rewrite /(user/.*)?/api/v2/sql(.*) /$1/api/v2/sql$2  break;
proxy_set_header        Host $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;
proxy_pass http://127.0.0.1:8080;

}

location ^~ /assets { root /cartodb/public; }

location / { proxy_set_header Host $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; proxy_pass http://127.0.0.1:3000; }

error_log /var/log/nginx/cartodb_error.log; access_log /var/log/nginx/cartodb_access.log; }

I am not sure whether should I make edits directly to nginx.conf under /etc/nginx/conf.d

Munsio commented 6 years ago

Hi @sindile, As mentioned in the readme you can add custom location parts in special files: https://github.com/CausticLab/rgon-proxy#customdefault-nginx-vhost--location-config

Just name the file "mydomain_location" and in there you can put all the location blocks.

sindile commented 6 years ago

Thanks