0

I seem to have a problem, so I have a reverse proxy which did a proxy pass to my git, now I wanted to add my portfolio. The first thing I did is made a new config portfolio.conf and did a proxy pass to. since that went wrong already I tried to put it in the same config and changed the proxy pass to proxy redirect same problem though.

Currently portfolio redirects to my git server and you get a cert bad domain.

what seems to be the problem?

config:

    server {
    listen 443 ssl;
    listen [::]:443 ssl;

    #listen 80;
    #listen [::]:80;

    server_name git.timclinckemalie.me

    ssl_certificate /etc/letsencrypt/git.timclinckemalie.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/git.timclinckemalie.me/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    #ssl_prefer_server_ciphers on;
    #ssl_session_cache shared:SSL:10m;
    ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256$

    location / {
        proxy_redirect  http://192.168.0.68;
    }
}


server {
    listen 443 ssl;
    listen [::]:443 ssl;

    #listen 80;
    #listen [::]:80;

    server_name portfolio.timclinckemalie.me

    ssl_certificate /etc/letsencrypt/portfolio.timclinckemalie.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/portfolio.timclinckemalie.me/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    #ssl_prefer_server_ciphers on;
    #ssl_session_cache shared:SSL:10m;
    ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256$

    location / {
        proxy_redirect http://192.168.0.83:5104;
    }
}

EDIT:

Changed configs reverseproxy.conf <- I already had this one:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    #listen 80;
    #listen [::]:80;

    server_name git.timclinckemalie.me

    ssl_certificate /etc/letsencrypt/git.timclinckemalie.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/git.timclinckemalie.me/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    #ssl_prefer_server_ciphers on;
    #ssl_session_cache shared:SSL:10m;
    ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256$

    location / {
        proxy_pass  http://192.168.0.68;
    }
}

new portfolio config:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    listen 80;
    listen [::]:80;

    server_name portfolio.timclinckemalie.me

    ssl_certificate /etc/letsencrypt/portfolio.timclinckemalie.me-001/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/portfolio.timclinckemalie.me-001/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    #ssl_prefer_server_ciphers on;
    #ssl_session_cache shared:SSL:10m;
    ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA25$

    location / {
        proxy_pass http://192.168.0.83:5104;
    }
}

result when i ask a certificate:

Cert

EDit2:

so with current config of edit1 i tried to bypass my certificate by going to my domain with http but i get 404not found, I guess this explains the first thing.

Edit3: I have found half my solution I had to add a server block entry in the config in /etc/nginx/config.d then asked a new cert and that worked perfectly, however i do get a 502 bad gateway now :(

6
  • 2
    Firstly, you want proxy_pass, not proxy_redirect. Once you've changed it back, please provide the error message. Secondly, something is wrong with your certificate setup as portfolio.timclinckemalie.me is returning the git.timclinckemalie.me certificate.
    – Quetza
    Mar 20 at 15:22
  • thats weird i did certbot -d portfolio.timclinckemalie.me Mar 20 at 16:41
  • I quiet don't understand so i replace back to proxy_pass and placed back my server block into portfolio.conf-> i commented out port 80 in my git block and opend port 80 in my portfolio block. i did certbot -d portfolio.timclinckemalie.me but in chrom it's issued to git which is kinda strange since there was no http connection to git only to portfolio :/ Mar 20 at 20:18
  • Please update your question with the current configuration and describe the error you're seeing along with the log entries. . The certificates are possibly a different issue which can be resolved later.
    – Quetza
    Mar 21 at 8:44
  • ans dont forgot to restart the nginx service in case sometimes cerbot seems not to be very successful doing it for you
    – djdomi
    Mar 21 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.