server {
listen 80;
server_name example.com;
access_log /var/log/nginx/stp.access.log;
error_log /var/log/nginx/stp.error.log;
client_max_body_size 64m;
location / {
uwsgi_pass unix:///tmp/stp.sock;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
#
}
location /static/ {
alias /home/alx/stp/static/;
}
}
server {
server_name www.example.com ;
return 301 $scheme://example.com$request_uri;
}
server {
listen 80;
server_name static.example.com;
access_log /var/log/nginx/static.stp.access.log;
error_log /var/log/nginx/static.stp.error.log;
#location ~* \.(eot|ttf|woff|woff2)$ {
# add_header Access-Control-Allow-Origin *;
#}
location / {
add_header Access-Control-Allow-Origin *;
alias /home/alx/stp/static/;
}
}
server {
listen 80;
server_name *.example.com;
access_log /var/log/nginx/stp.access.log;
error_log /var/log/nginx/stp.error.log;
location / {
uwsgi_pass unix:///tmp/landing.sock;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}
location /static/ {
alias /home/alx/stp/static/;
}
}
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
rewrite ^ https://example.com$request_uri? permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
include /etc/nginx/snippets/ssl;
if ($host !~* ^(example.com)$ ){return 444;}
if ($request_method !~ ^(GET|HEAD|POST)$ ){return 444;}
access_log /var/log/nginx/stp.access.log;
error_log /var/log/nginx/stp.error.log;
client_max_body_size 64m;
location / {
uwsgi_pass unix:///tmp/stp.sock;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
#
}
location /static/ {
alias /home/alx/stp/static/;
}
}
server {
server_name www.example.com ;
return 301 https://example.com$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name static.example.com;
rewrite ^ https://static.example.com$request_uri? permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name static.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
include /etc/nginx/snippets/ssl;
access_log /var/log/nginx/static.stp.access.log;
error_log /var/log/nginx/static.stp.error.log;
#location ~* \.(eot|ttf|woff|woff2)$ {
# add_header Access-Control-Allow-Origin *;
#}
location / {
add_header Access-Control-Allow-Origin *;
alias /home/alx/stp/static/;
}
}
stream {
upstream stream_backend {
zone tcp_servers 64k;
server 192.168.55.201:3308;
server 192.168.55.202:3308;
server 192.168.55.203:3308;
}