reverse proxy - NGINX redirect http to https and www. to non-www -


i got certificates made let's encrypt working.
struggling nginx though. i've been using revers proxy, , found quite good.
site can accessed https://example.net , i'd if http://www.example.net , https://www.example.net redirected https://example.net .
current configuration doesn't work.

server {    listen       80;    server_name example.net;    return 301 https://example.net$request_uri; }  server {    listen 80;    server_name www.example.net;    rewrite ^/(.*) https://example.net/$1 permanent; }  server {    listen 443 ssl;     server_name  example.net;      ssl_certificate /home/shiro/le-cert.crt;     ssl_certificate_key /home/shiro/le-cert.key;     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 https://10.0.0.3:443;     } }  server {    listen 443;    server_name www.example.net;    rewrite ^/(.*) https://example.net/$1 permanent; } 

how go setting up?
nginx running on ubuntu if matters.

edit: oh. my. god.
feel stupid right now..
found problem, fixed it, , when set thet acme package on pfsense had forward http pfsense:8082. didn't disable , didn't enable 1 forwards nginx..

oh. my. god.
feel stupid right now..
found problem, fixed it, , when set thet acme package on pfsense had forward http pfsense:8082. didn't disable , didn't enable 1 forwards nginx..


Comments

  1. The vulnerabilities are based on the CVE vulnerability naming standard and are organized according to severity, determined by the Common Vulnerability Scoring System (CVSS) standard. The division of high, medium, and low severities correspond to the following scores:
    vumoo

    ReplyDelete

Post a Comment

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -