This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
69 lines (58 loc) · 2.34 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
worker_processes 1;
events {
worker_connections 1024;
}
http {
# Just including the generic mime types
# e.g. .gif .png .html
# We also set the default return type to text/plain
# Meaning if we dont match any mime types
# That we will return the document as a text/plain
# This could be insecure but i dont believe that will be the case
include mime.types;
default_type text/plain;
# Here we are defining the default timeouts
# They ensure that clients recieve the page eventually,
# Even if the site is slow or being ddosed.
# They also ensure that if the site doesnt respond,
# then the client will drop the connection.
keepalive_timeout 65;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
fastcgi_read_timeout 600;
server {
# Define the root of the server to serve files from
root "Y:/";
# Define the port for the Reverse Proxy/Web Server to run on
listen 80;
# Define the hostname to listen to
# We listen to all hostnames while we are testing
# During production this would be something like
# using specific hostnames: server_name toka-fiteness.com www.toka-fiteness.com
# or a wildcard allow all on domain: server_name *.toka-fiteness.com
server_name _;
index index.php;
# This will handle all of our api requests
# Ensuring all requests are sent as a prefix of our api index
location /api/ {
# root "Z:/api";
rewrite ^/api/ /api/index.php;
}
# This gateway will handle normal requests to frontend pages
location / {
rewrite ^/ /frontend/index.php;
index index.php;
}
# Pass all reqeuests to our PHP Scripts (e.g. index.php or auth.php)
# to our FastCGI server Thats listening on 127.0.0.1:9000
location ~ \.php$ {
internal;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}