I am trying to configure Nginx to use a domain like proxy pass to github pages, and also to have a landing page on the root domain.
With this configuration the proxy to githubpages work fine, but if I check example.com it goes to github pages also.
My configuration is this:
server {
listen 80 ;
index index.html index.htm;
server_name example.com www.example.com ;
location = / {
index index.html;
root /home/landing/public_html ;
}
location / { #this work fine
proxy_set_header Host enlaorbita.github.io;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://user.github.io/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
It have to do:
example.com or www.example.com --> go to my own landing (It doesn't work)
example.com/repo/ --> go to user.github.io/repo. Yes it works
Thanks