45 lines
1.0 KiB
Bash
45 lines
1.0 KiB
Bash
|
#!/bin/sh
|
||
|
echo "error_log /var/log/nginx/error.log notice;
|
||
|
pid /var/run/nginx.pid;
|
||
|
|
||
|
worker_processes $WEB_WORKERS;
|
||
|
user nginx;
|
||
|
|
||
|
events {
|
||
|
worker_connections 1024;
|
||
|
}
|
||
|
|
||
|
http {
|
||
|
log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" \$status \$body_bytes_sent "\$http_referer" "\$http_user_agent" "\$http_x_forwarded_for"';
|
||
|
access_log /var/log/nginx/access.log main;
|
||
|
default_type application/octet-stream;
|
||
|
include /etc/nginx/mime.types;
|
||
|
sendfile on;
|
||
|
#tcp_nopush on;
|
||
|
keepalive_timeout 65;
|
||
|
gzip on;
|
||
|
server {
|
||
|
listen 80;
|
||
|
location / {
|
||
|
index index.html;
|
||
|
root /srv/www;
|
||
|
}
|
||
|
location /api {
|
||
|
rewrite /api/?(.*) /\$1 break;
|
||
|
proxy_set_header X-Real-IP \$remote_addr;
|
||
|
proxy_pass http://localhost:8080;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
" > /etc/nginx/nginx.conf
|
||
|
|
||
|
echo "[default]
|
||
|
ip_header = \"X-Real-IP\"
|
||
|
log_level = \"normal\"
|
||
|
workers = $WEB_WORKERS
|
||
|
address = \"0.0.0.0\"
|
||
|
port = 8080
|
||
|
" > /Rocket.toml
|
||
|
|
||
|
oracle &
|
||
|
nginx -g "daemon off;"
|