How do I configure nginx for proxy_pass and ssl redirect? - Stack Overflow
I'm using this guide to set up nginx to serve a dash application, but unable to connect to the webserver with https. Here's my nginx.conf file:
events {
worker_connections 1024;
}
http {
server_tokens off;
charset utf-8;
# always redirect to https
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
# use the certificates
ssl_certificate /etc/letsencrypt/live/{my_domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{my_domain}/privkey.pem;
server_name {my_domain};
root /var/www/html;
index index.php index.html index.htm;
location / {
proxy_pass http://my-dash-app:5000/;
}
location ~ /.well-known/acme-challenge/ {
root /var/www/certbot;
}
}
}
Where {my_domain}
is my actual domain name. fullchain.pem
and privkey.pem
files appear to have been generated, and I can use https://localhost to connect on my LAN, but I get a message in the browser saying the site is not secure and have to add an exception before it will load.
What am I doing wrong here?
最新文章
- 紫光集团两年内豪掷90亿美元
- 智能手机与云的强大融合
- 惠普CEO惠特曼访华:我们不走IBM之路
- Google的AR眼镜
- c++ - What is the fastest way to upcast std::shared_ptr<std::unique_ptr<T>>? - Stack Overflow
- Integration-testing a Spring Boot @Service without SpringBootApplication - Stack Overflow
- swiftui - Ambiguous Init warning that doesn't make sense - Stack Overflow
- excel - Challange with DSUM Function: How can I use the DSUM function to sum values based on criteria that match the starting ch
- c++ - OpenCV Build Fails with "FilesNVIDIA.obj" Error in CMake and Visual Studio - Stack Overflow
- caching - Pytorch: the cache is constantly increasing - Stack Overflow
- rust - Basic bracket-lib example crashes with “unsafe precondition(s) violated: slice::from_raw_parts” - Stack Overflow
- flutter - Uber category selection animation - Stack Overflow
- d3.js - d3 - graph is rendered outside the svg - Stack Overflow
- ios - How should I replace semaphores in my SwiftHealthKit app? - Stack Overflow
- javascript - error in getting data from firebase "user": "[object Object]"} in firebase - St
- html - django multi-level template extending - Stack Overflow
- class - Python: trying to use exec(), pathlib and __file__ in combination fails - Stack Overflow