-
-
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
Closed
Closed
Nginx docker temp #700
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9c18be0
add dockerfile
ZacharyCChang0828 5f8fd4d
nginx now builds
ZacharyCChang0828 77e8d15
.
ZacharyCChang0828 8cc9760
Edit dependencies so the nginx now depends on the app instead of the …
ZacharyCChang0828 b1e0391
edit path to configuration file
ZacharyCChang0828 3d27884
remove copy pasted configuration code and add reference to dockerfile…
ZacharyCChang0828 c898b1e
reset nginx.conf
ZacharyCChang0828 d748417
Merge branch 'master' into nginx_docker_temp
ZacharyCChang0828 899fc65
Merge branch 'master' into nginx_docker_temp
ZacharyCChang0828 712d11d
modify run server command to start nginx too when running run_dev_server
ZacharyCChang0828 955a2e0
Merge branch 'master' into nginx_docker_temp
ZacharyCChang0828 c4f4189
change nginx.conf back to the one that will serve rails app
ZacharyCChang0828 c157dc0
Moved the modified nginx configuration folder to the repository.
ZacharyCChang0828 d9446d8
return behavior of bin files
ZacharyCChang0828 4a3fb5c
this file was in the folder but does not compile
ZacharyCChang0828 8c25947
basic documentation to configuration line
ZacharyCChang0828 4efc9ca
additional comment
ZacharyCChang0828 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Allow 10 Megabyte for zone=one, maximum request rate is 10 per second | ||
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#block request from IP | ||
#deny 192.168.176.1; | ||
|
||
#block request from all | ||
#deny all; | ||
|
||
#allow request from IP (whitelist) | ||
#allow 192.168.176.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_max_body_size 10M; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_max_body_size 10M; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
# } | ||
#} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
proxy_read_timeout 600s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#Modified from: https://itnext.io/docker-rails-puma-nginx-postgres-999cd8866b18 | ||
|
||
#set upstream rail app | ||
upstream safecastapi { | ||
server app:3000; | ||
} | ||
|
||
|
||
server{ | ||
server_name safecastapi; | ||
# define the public application root | ||
root /var/www/safecastapi/public; | ||
index index.html; | ||
listen 80; | ||
# 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 / { | ||
# place rate limit rule zone=one before request to all location | ||
limit_req zone=one; | ||
#serve files to location @rails | ||
try_files $uri @rails; | ||
} | ||
#define @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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You can delete the
.bak
files to reduce the distraction.