-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nginx docker temp #700
Nginx docker temp #700
Changes from 14 commits
9c18be0
5f8fd4d
77e8d15
8cc9760
b1e0391
3d27884
c898b1e
d748417
899fc65
712d11d
955a2e0
c4f4189
c157dc0
d9446d8
4a3fb5c
8c25947
4efc9ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM nginx |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<title>Site Maintenance</title> | ||
<style> | ||
body { text-align: center; padding: 150px; } | ||
h1 { font-size: 50px; } | ||
body { font: 20px Helvetica, sans-serif; color: #333; } | ||
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | ||
a { color: #dc8100; text-decoration: none; } | ||
a:hover { color: #333; text-decoration: none; } | ||
</style> | ||
|
||
<article> | ||
<h1>We’ll be back soon!</h1> | ||
<div> | ||
<p>Sorry for the inconvenience but we’re performing some maintenance at the moment. If you need to you can always <a href="mailto:[email protected]">contact us</a>, otherwise we’ll be back online shortly!</p> | ||
<p>— The Safecast Team</p> | ||
</div> | ||
</article> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#Modified from: https://itnext.io/docker-rails-puma-nginx-postgres-999cd8866b18 | ||
|
||
upstream safecastapi { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would appreciate it if you could leave a comment on this pull request to describe where you made changes and what changes you made. |
||
server app:3000; | ||
} | ||
|
||
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a good start, but, if it is possible, it would be best if we could add this configuration to a new file instead of modifying an existing one. |
||
|
||
server{ | ||
server_name safecastapi; | ||
# define the public application root | ||
root /var/www/safecastapi/public; | ||
index index.html; | ||
# deny requests for files that should never be accessed | ||
location ~ /\. { | ||
deny all; | ||
} | ||
location ~* ^.+\.(rb|log)$ { | ||
deny all; | ||
} | ||
|
||
# serve static (compiled) assets directly if they exist (for rails production) | ||
location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ { | ||
try_files $uri @rails; | ||
access_log off; | ||
gzip_static on; | ||
# to serve pre-gzipped version | ||
expires max; | ||
add_header Cache-Control public; | ||
|
||
add_header Last-Modified ""; | ||
add_header ETag ""; | ||
break; | ||
} | ||
|
||
location / { | ||
limit_req zone=one; | ||
try_files $uri @rails; | ||
} | ||
location @rails { | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_pass http://safecastapi; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#deny 192.168.176.1; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
server { | ||
listen 81; | ||
server_name _ localhost; | ||
root /var/app/current/public/maintenance; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
server { | ||
listen 81; | ||
server_name _ localhost; | ||
root /var/app/current/public/maintenance; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_max_body_size 10M; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_max_body_size 10M; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can delete the |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's supposed to be here? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# A virtual host using mix of IP-, name-, and port-based configuration | ||
# | ||
|
||
#server { | ||
# listen 8000; | ||
# listen somename:8080; | ||
# server_name somename alias another.alias; | ||
|
||
# location / { | ||
# root html; | ||
# index index.html index.htm; | ||
# } | ||
#} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
proxy_read_timeout 600s; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param QUERY_STRING $query_string; | ||
fastcgi_param REQUEST_METHOD $request_method; | ||
fastcgi_param CONTENT_TYPE $content_type; | ||
fastcgi_param CONTENT_LENGTH $content_length; | ||
|
||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
fastcgi_param REQUEST_URI $request_uri; | ||
fastcgi_param DOCUMENT_URI $document_uri; | ||
fastcgi_param DOCUMENT_ROOT $document_root; | ||
fastcgi_param SERVER_PROTOCOL $server_protocol; | ||
fastcgi_param REQUEST_SCHEME $scheme; | ||
fastcgi_param HTTPS $https if_not_empty; | ||
|
||
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | ||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | ||
|
||
fastcgi_param REMOTE_ADDR $remote_addr; | ||
fastcgi_param REMOTE_PORT $remote_port; | ||
fastcgi_param SERVER_ADDR $server_addr; | ||
fastcgi_param SERVER_PORT $server_port; | ||
fastcgi_param SERVER_NAME $server_name; | ||
|
||
# PHP only, required if PHP was built with --enable-force-cgi-redirect | ||
fastcgi_param REDIRECT_STATUS 200; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param QUERY_STRING $query_string; | ||
fastcgi_param REQUEST_METHOD $request_method; | ||
fastcgi_param CONTENT_TYPE $content_type; | ||
fastcgi_param CONTENT_LENGTH $content_length; | ||
|
||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
fastcgi_param REQUEST_URI $request_uri; | ||
fastcgi_param DOCUMENT_URI $document_uri; | ||
fastcgi_param DOCUMENT_ROOT $document_root; | ||
fastcgi_param SERVER_PROTOCOL $server_protocol; | ||
fastcgi_param REQUEST_SCHEME $scheme; | ||
fastcgi_param HTTPS $https if_not_empty; | ||
|
||
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | ||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | ||
|
||
fastcgi_param REMOTE_ADDR $remote_addr; | ||
fastcgi_param REMOTE_PORT $remote_port; | ||
fastcgi_param SERVER_ADDR $server_addr; | ||
fastcgi_param SERVER_PORT $server_port; | ||
fastcgi_param SERVER_NAME $server_name; | ||
|
||
# PHP only, required if PHP was built with --enable-force-cgi-redirect | ||
fastcgi_param REDIRECT_STATUS 200; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
fastcgi_param QUERY_STRING $query_string; | ||
fastcgi_param REQUEST_METHOD $request_method; | ||
fastcgi_param CONTENT_TYPE $content_type; | ||
fastcgi_param CONTENT_LENGTH $content_length; | ||
|
||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
fastcgi_param REQUEST_URI $request_uri; | ||
fastcgi_param DOCUMENT_URI $document_uri; | ||
fastcgi_param DOCUMENT_ROOT $document_root; | ||
fastcgi_param SERVER_PROTOCOL $server_protocol; | ||
fastcgi_param REQUEST_SCHEME $scheme; | ||
fastcgi_param HTTPS $https if_not_empty; | ||
|
||
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | ||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | ||
|
||
fastcgi_param REMOTE_ADDR $remote_addr; | ||
fastcgi_param REMOTE_PORT $remote_port; | ||
fastcgi_param SERVER_ADDR $server_addr; | ||
fastcgi_param SERVER_PORT $server_port; | ||
fastcgi_param SERVER_NAME $server_name; | ||
|
||
# PHP only, required if PHP was built with --enable-force-cgi-redirect | ||
fastcgi_param REDIRECT_STATUS 200; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
fastcgi_param QUERY_STRING $query_string; | ||
fastcgi_param REQUEST_METHOD $request_method; | ||
fastcgi_param CONTENT_TYPE $content_type; | ||
fastcgi_param CONTENT_LENGTH $content_length; | ||
|
||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
fastcgi_param REQUEST_URI $request_uri; | ||
fastcgi_param DOCUMENT_URI $document_uri; | ||
fastcgi_param DOCUMENT_ROOT $document_root; | ||
fastcgi_param SERVER_PROTOCOL $server_protocol; | ||
fastcgi_param REQUEST_SCHEME $scheme; | ||
fastcgi_param HTTPS $https if_not_empty; | ||
|
||
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | ||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | ||
|
||
fastcgi_param REMOTE_ADDR $remote_addr; | ||
fastcgi_param REMOTE_PORT $remote_port; | ||
fastcgi_param SERVER_ADDR $server_addr; | ||
fastcgi_param SERVER_PORT $server_port; | ||
fastcgi_param SERVER_NAME $server_name; | ||
|
||
# PHP only, required if PHP was built with --enable-force-cgi-redirect | ||
fastcgi_param REDIRECT_STATUS 200; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>This is the title of the webpage!</title> | ||
</head> | ||
<body> | ||
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
|
||
# This map is not a full koi8-r <> utf8 map: it does not contain | ||
# box-drawing and some other characters. Besides this map contains | ||
# several koi8-u and Byelorussian letters which are not in koi8-r. | ||
# If you need a full and standard map, use contrib/unicode2nginx/koi-utf | ||
# map instead. | ||
|
||
charset_map koi8-r utf-8 { | ||
|
||
80 E282AC ; # euro | ||
|
||
95 E280A2 ; # bullet | ||
|
||
9A C2A0 ; # | ||
|
||
9E C2B7 ; # · | ||
|
||
A3 D191 ; # small yo | ||
A4 D194 ; # small Ukrainian ye | ||
|
||
A6 D196 ; # small Ukrainian i | ||
A7 D197 ; # small Ukrainian yi | ||
|
||
AD D291 ; # small Ukrainian soft g | ||
AE D19E ; # small Byelorussian short u | ||
|
||
B0 C2B0 ; # ° | ||
|
||
B3 D081 ; # capital YO | ||
B4 D084 ; # capital Ukrainian YE | ||
|
||
B6 D086 ; # capital Ukrainian I | ||
B7 D087 ; # capital Ukrainian YI | ||
|
||
B9 E28496 ; # numero sign | ||
|
||
BD D290 ; # capital Ukrainian soft G | ||
BE D18E ; # capital Byelorussian short U | ||
|
||
BF C2A9 ; # (C) | ||
|
||
C0 D18E ; # small yu | ||
C1 D0B0 ; # small a | ||
C2 D0B1 ; # small b | ||
C3 D186 ; # small ts | ||
C4 D0B4 ; # small d | ||
C5 D0B5 ; # small ye | ||
C6 D184 ; # small f | ||
C7 D0B3 ; # small g | ||
C8 D185 ; # small kh | ||
C9 D0B8 ; # small i | ||
CA D0B9 ; # small j | ||
CB D0BA ; # small k | ||
CC D0BB ; # small l | ||
CD D0BC ; # small m | ||
CE D0BD ; # small n | ||
CF D0BE ; # small o | ||
|
||
D0 D0BF ; # small p | ||
D1 D18F ; # small ya | ||
D2 D180 ; # small r | ||
D3 D181 ; # small s | ||
D4 D182 ; # small t | ||
D5 D183 ; # small u | ||
D6 D0B6 ; # small zh | ||
D7 D0B2 ; # small v | ||
D8 D18C ; # small soft sign | ||
D9 D18B ; # small y | ||
DA D0B7 ; # small z | ||
DB D188 ; # small sh | ||
DC D18D ; # small e | ||
DD D189 ; # small shch | ||
DE D187 ; # small ch | ||
DF D18A ; # small hard sign | ||
|
||
E0 D0AE ; # capital YU | ||
E1 D090 ; # capital A | ||
E2 D091 ; # capital B | ||
E3 D0A6 ; # capital TS | ||
E4 D094 ; # capital D | ||
E5 D095 ; # capital YE | ||
E6 D0A4 ; # capital F | ||
E7 D093 ; # capital G | ||
E8 D0A5 ; # capital KH | ||
E9 D098 ; # capital I | ||
EA D099 ; # capital J | ||
EB D09A ; # capital K | ||
EC D09B ; # capital L | ||
ED D09C ; # capital M | ||
EE D09D ; # capital N | ||
EF D09E ; # capital O | ||
|
||
F0 D09F ; # capital P | ||
F1 D0AF ; # capital YA | ||
F2 D0A0 ; # capital R | ||
F3 D0A1 ; # capital S | ||
F4 D0A2 ; # capital T | ||
F5 D0A3 ; # capital U | ||
F6 D096 ; # capital ZH | ||
F7 D092 ; # capital V | ||
F8 D0AC ; # capital soft sign | ||
F9 D0AB ; # capital Y | ||
FA D097 ; # capital Z | ||
FB D0A8 ; # capital SH | ||
FC D0AD ; # capital E | ||
FD D0A9 ; # capital SHCH | ||
FE D0A7 ; # capital CH | ||
FF D0AA ; # capital hard sign | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the filename: files are sorted in lexical order, not numeric order, so this will not behave the way that you think it will.
The convention is to use two digits, and if the ordering doesn't matter, use
50_
to put it in the middle.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the other files aren't following the normal convention, so I guess it doesn't matter that much.
1_
will sort before anything that begins with a letter of the alphabet.