-
-
Save shahryarjb/de25715f06ebad6fab048d95448532ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes auto; | |
#error_log /dev/fd/1 crit; | |
pid /var/run/nginx.pid; | |
worker_rlimit_nofile 51200; | |
events { | |
use epoll; | |
worker_connections 51200; | |
multi_accept on; | |
accept_mutex_delay 100ms; | |
} | |
http { | |
include mime.types; | |
# 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 /dev/fd/1 main; | |
gzip on; | |
set_real_ip_from 172.18.0.0/16; | |
real_ip_header X-Forwarded-For; | |
server { | |
listen 443 default; | |
server_name _; | |
ssl on; | |
ssl_certificate /etc/***/live/***.ir/fullchain.pem; | |
ssl_certificate_key /***/letsencrypt/live/****.ir/privkey.pem; | |
return 403; | |
} | |
server { | |
listen 80; | |
server_name ****.ir www.****.ir; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name ***.ir www.***.ir; | |
ssl_certificate /etc/***/live/***.ir/fullchain.pem; | |
ssl_certificate_key /etc/***/live/****.ir/privkey.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers '*****'; | |
location / { | |
root /name_app/; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Remote-Addr $remote_addr; | |
proxy_set_header Host $host; | |
proxy_http_version 1.1; | |
proxy_pass http://name_site:4000; | |
} | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} | |
server { | |
listen 80; | |
server_name mail.****.ir; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name mail.****.ir; | |
ssl_certificate /etc/****/live/****.ir/fullchain.pem; | |
ssl_certificate_key /etc/****/live/***.ir/privkey.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers '*****'; | |
error_log /var/log/nginx/localhost.error_log info; | |
root /var/www/html; | |
location / { | |
try_files $uri /index.php$is_args$args; | |
} | |
location ~ ^/.+\.php(/|$) { | |
fastcgi_pass fpm:9000; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment