balderdashy / balderdashy/sails

Subdomain with Nginx example below not working

Open
#7,360 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Hi guys! I'm trying to find some example about to make a simple subdomain Nginx config but unfortunately i can't find any example to make it works in my project.

Basically i have a subdomain: bola.mytab.com.br
running in a custom port using this command:
rails lift --prod --port 3012

and after to install my certbot in a available sites with the same name: bola.mytab.com.br i also configured my nginx file this way:
could you help me please? thank you so much!

upstream app {
server http://127.0.0.1:3012;
}
server {

server_name bola.mytab.com.br;
location /app/ {
proxy_pass http://127.0.0.1:3012;
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 https;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header Host $http_host;
proxy_redirect off;
}

error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/bola.mytab.com.br/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/bola.mytab.com.br/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 = bola.mytab.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name bola.mytab.com.br;
return 404; # managed by Certbot
}

Contributor guide

Open the contributing guide

Research direction

Start with the supplied Nginx server block and the application endpoint launched by `rails lift --prod --port 3012`; verify the request path and proxy behavior for `bola.mytab.com.br`. Done would be a reproducible configuration that serves the subdomain successfully over HTTPS, but the issue names no repository file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nginx
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.