-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
38 lines (32 loc) · 897 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# HTTP directives - port 80
server {
listen 80 default_server;
listen [::]:80 default_server;
# Redirection from HTTP to HTTPS (SSL)
# Reference:
# https://www.hostinger.com.br/tutoriais/nginx-redirect-http-to-https/
return 301 https://$host$request_uri;
}
# HTTPS (SSL) directives - port 443
server {
listen 443 ssl;
listen [::]:443 ssl;
# SSL certificate files location
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/certs/localhost.key;
server_name _;
root /var/www/localhost;
index index.html index.htm index.php;
# Directives for all files and folders within the server
location / {
# Turn autoindex on
autoindex on;
# Check if file exist
try_files $uri $uri/ =404;
}
# Directives for PHP files
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
}