server {
listen 80;
server_name domain.com;
location /.well-known/acme-challenge {
root /usr/share/nginx/html;
}
location / {
return 301 https://$host$request_uri;
}
}
# main block
server {
listen 443 ssl;
server_name domain.com;
#SSL:
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.com/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
location / {
proxy_pass http://127.0.0.1:5000;
#proxy_redirect off;
#proxy_redirect https://domain.com/ http://127.0.0.1:5000/;
# proxy headers
proxy_set_header Host $host;
proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
# proxy_cache_bypass $http_upgrade;
# proxy_headers_hash_max_size 512;
# proxy_headers_hash_bucket_size 128;
include proxy_params;
}
}
app.register_blueprint(auth, url_prefix='/')
app.register_blueprint(views, url_prefix='/')
app.register_blueprint(views_en, url_prefix='/en')
app.register_blueprint(auth_en, url_prefix='/en')
@views_en.route('/', methods=['GET', 'POST'])
def home():
...
render_template("en_templates/home.html")