user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
# Hide server version
server_tokens off;
# Log format for access logs
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;
# Basic performance optimizations
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
# HTTP server block
server {
listen 80;
server_name www.wisewalletai.com;
# Custom error page for 403 Forbidden
error_page 403 /custom_403.html;
location = /custom_403.html {
root /usr/share/nginx/html;
internal;
}
location /report.html {
root /usr/share/nginx/html;
index report.html;
# Restrict access by IP
allow 206.84.167.234;
allow 84.68.111.180;
deny all;
}
# Redirect all other HTTP traffic to HTTPS
location / {
return 301 https://$host$request_uri;
}
}
# HTTPS server block
server {
listen 443 ssl;
server_name www.wisewalletai.com;
ssl_certificate /etc/ssl/wisewalletai/wisewalletai.com_ssl_certificate.cer;
ssl_certificate_key /etc/ssl/wisewalletai/_.wisewalletai.com_private_key.key;
root /usr/share/nginx/html;
index index.html report.html;
# Custom error page for 403 Forbidden
error_page 403 /custom_403.html;
location = /custom_403.html {
root /usr/share/nginx/html;
internal;
}
location /report.html {
root /usr/share/nginx/html;
index report.html;
# Restrict access by IP
allow 206.84.167.234;
allow 84.68.111.180;
deny all;
}
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
internal;
}
}
}