This is an excellent idea, and something I would use myself. In the code I've actually provided for Nginx services to define sites which are purely reverse-proxies as it seemed likely to be useful. I just have to create an approachable UI for it. I will move it up the list in my to-do ๐
In the meantime, you actually can do this, if you're willing to hand-code the nginx config. It would go inside your specific .indigostack
file bundle (right-click it in your stack list) at system/nginx_reverse_proxy/conf/sites-enabled/mycustomreverseproxy.conf
. It would look something like:
server {
server_name my-site.test;
resolver 127.0.0.1;
listen 80;
listen 443 ssl;
ssl_certificate "{{ssl_certificate_dir}}/cert.pem";
ssl_certificate_key "{{ssl_certificate_dir}}/key.pem";
access_log "{{log_path}}/my-site.dev.log";
location / {
proxy_pass http://localhost:3000;
proxy_ssl_server_name on;
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-Host $server_name;
}
}
Sorry if that's not 100% โย it's completely untested. Also please note, this is NOT the final intended solution for this, long-term! I certainly do not want people to have to hand-code nginx reverse proxy configurations in order to get Indigo to do this. But for those who are sufficiently motivated, it's possible ๐