-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqml.phanous.ir.nginx
108 lines (84 loc) · 2.95 KB
/
qml.phanous.ir.nginx
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
server {
listen 443;
ssl on;
server_name qml.phanous.ir;
ssl_certificate /etc/letsencrypt/live/qml.phanous.ir/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/qml.phanous.ir/privkey.pem; # managed by Certbot
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
#access_log /var/log/nginx/host.access.log main;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
# client_body_temp_path /var/nginx/client_body_temp;
proxy_connect_timeout 70;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_send_lowat 12000;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
# proxy_temp_path /var/nginx/proxy_temp;
charset koi8-r;
location / {
proxy_pass http://localhost:3000/; # frontend
}
location /admin/ {
proxy_pass http://localhost:5000/admin/; # admin panel
}
location /api/v1/ {
proxy_pass http://localhost:8000/; # backend
}
location /api/v1/static/ {
rewrite ^/api/v1/static(.*) $1 break;
root /home/resana/backend/images;
}
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
server {
if ($host = qml.phanous.ir) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ( $host ~* ^(qml.phanous.ir|www.qml.phanous.ir)$ ) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name qml.phanous.ir;
return 404; # managed by Certbot
}
server {
listen 80 default_server;
return 444;
}