listen 80;
server_name *.universal-chat.net;
return 301 $server_name$request_uri;
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_rlimit_nofile 150000;
events {
worker_connections 8000;
multi_accept on;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
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;
gzip off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
client_body_buffer_size 128k;
server {
listen 80;
server_name 127.0.0.1;
root /var/www/html;
index index.html index.php;
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name universal-chat.net *.universal-chat.net;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name universal-chat.net www.universal-chat.net;
root /var/www/html/universal_chat;
index index.html index.php;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate "/etc/letsencrypt/live/universal-chat.net/cert.pem";
ssl_certificate_key "/etc/letsencrypt/live/universal-chat.net/privkey.pem";
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /api/ {
deny all;
}
}
server {
listen 443 ssl;
server_name api.universal-chat.net;
root /var/www/html/universal_chat/api;
index index.php;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate "/etc/letsencrypt/live/api.universal-chat.net/cert.pem";
ssl_certificate_key "/etc/letsencrypt/live/api.universal-chat.net/privkey.pem";
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^(methods|includes) {
deny all;
}
}
}
server {
listen 80;
server_name universal-chat.net *.universal-chat.net;
return 301 https://$host$request_uri;
}
server {
listen 80;
server_name universal-chat.net www.universal-chat.net;
return 301 https://universal-chat.net$request_uri;
}
server {
listen 80;
server_name api.universal-chat.net;
return 301 https://api.universal-chat.net$request_uri;
}
curl -D - -o /dev/null -s http://universal-chat.net
curl -D - -o /dev/null -s http://api.universal-chat.net