feat: add nginx

This commit is contained in:
DarkCat09 2025-03-26 14:51:39 +04:00
parent c5300b9912
commit c54c836299
Signed by: DarkCat09
SSH key fingerprint: SHA256:SnH1iYY/ogxxRmt1I6piy+aVUUzrOWvfksQWfhZ8JUM
2 changed files with 36 additions and 1 deletions

35
nginx.conf Normal file
View 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 "";
}
}
}

View file

@ -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)