-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
120 lines (111 loc) · 3.34 KB
/
nginx.conf
File metadata and controls
120 lines (111 loc) · 3.34 KB
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
109
110
111
112
113
114
115
116
117
118
119
user www-data;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 4096;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_body_temp_path /tmp/client_temp 1 2;
client_max_body_size 200m;
client_body_buffer_size 128k;
map $status $status_text {
default "Unspecified Error";
200 "Success";
400 "Bad Request";
401 "Unauthorized";
403 "Forbidden";
404 "Not Found";
500 "Internal Server Error";
502 "Bad Gateway";
503 "Service Unavailable";
504 "Gateway Timeout";
}
server {
listen 80;
server_name _;
location /socket.io {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:4555/socket.io;
}
location /xterm {
rewrite /xterm(.*) $1 break;
proxy_pass http://127.0.0.1:4555;
# include /etc/nginx/uwsgi_params;
# uwsgi_pass 127.0.0.1:4555;
# include uwsgi_params;
# uwsgi_pass unix:/home/gersy/Downloads/pyxterm.js/pyxterm.sock;
}
error_page 400 401 403 404 500 502 503 504 /errors.html;
location ~ /errors.html {
add_header Content-Type text/html;
return 200 "
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>$status_text</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
html {
color: #888;
text-align: center;
width: 100%;
height: 100%;
}
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 25px;
line-height: 1.42857143;
color: #c8c8c8;
background-color: #292c2e;
}
.container .jumbotron,
.container-fluid .jumbotron {
border-radius: 6px;
padding-left: 15px;
padding-right: 15px;
}
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #1c1e22;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron .container {
max-width: 100%;
}
</style>
</head>
<body>
<div class='container'>
<div class='jumbotron'>
<h1>$status</h1>
<h2>$status_text</h2>
</div>
</div>
</body>
</html>
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->";
}
}
}