-
Notifications
You must be signed in to change notification settings - Fork 2
/
localhost
42 lines (40 loc) · 1.29 KB
/
localhost
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
39
40
41
42
server {
# tells to listen to port 80
listen 80;
# same but for IPV6
listen [::]:80;
# tells the name(s) of our website
server_name localhost www.localhost;
# will redirect us to https://$host$request_uri;
# when we try to reach the website name in our browser
return 301 https://$host$request_uri;
}
server {
# tells to listen to port 443
listen 443 ssl;
# same but for IPV6
listen [::]:443 ssl;
# tells the name(s) of our website
server_name localhost www.localhost;
# Enables SSL protocol
ssl on;
# Tells where to look for SSL certificate
ssl_certificate /etc/ssl/nginx-selfsigned.crt;
# Tells where to look for SSL key
ssl_certificate_key /etc/ssl/nginx-selfsigned.key;
# Tells where to look for all the files related to our website
root /var/www/localhost;
# Enables autoindex to redirect us to the choice between wordpress and phpMyAdmin
autoindex on;
# Tells the possible names of the index file
index index.html index.htm index.php;
# Tells to check for existence of files before moving on
location / {
try_files $uri $uri/ =404;
}
# Specifies the php configuration
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}