feat: add nginx
This commit is contained in:
parent
c5300b9912
commit
c54c836299
2 changed files with 36 additions and 1 deletions
35
nginx.conf
Normal file
35
nginx.conf
Normal file
|
@ -0,0 +1,35 @@
|
|||
user nginx;
|
||||
pid /var/run/nginx.pid;
|
||||
worker_processes 4;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
access_log off;
|
||||
|
||||
default_type application/octet-stream;
|
||||
|
||||
gzip on;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream rpictrl {
|
||||
server 127.0.0.1:5544;
|
||||
keepalive 2;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name 10.3.141.1 localhost;
|
||||
|
||||
location / {
|
||||
proxy_pass http://rpictrl;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ type Result<T> = core::result::Result<T, ErrorWrapper>;
|
|||
|
||||
#[ntex::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let bind = std::env::var("BIND").unwrap_or("10.3.141.1:5544".to_owned());
|
||||
let bind = std::env::var("BIND").unwrap_or("127.0.0.1:5544".to_owned());
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.service(root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue