Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Owain Jones
gliders-webserver
Commits
733a79bd
Commit
733a79bd
authored
8 years ago
by
Gliders User
Browse files
Options
Download
Email Patches
Plain Diff
added production version of gliders nginx config (forces HTTPS)
parent
a7a98c97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
0 deletions
+132
-0
gliders.prod.nginx.conf
gliders.prod.nginx.conf
+132
-0
No files found.
gliders.prod.nginx.conf
0 → 100644
View file @
733a79bd
# https://www.nginx.com/resources/wiki/start/topics/recipes/symfony/
# NOTE: This makes any .php file other than app, app_dev and config.php
# downloadable. If you want one to run, add it to the "pass the PHP scripts to
# upstream FCGI" location section below. Be careful adding files with
# sensitive data like passwords inside them.
limit_req_zone
$
binary_remote_addr
zone
=
gliders
:
10
m
rate
=
10
r
/
s
;
server
{
listen
80
;
listen
[::]:
80
;
server_name
mars
.
noc
.
ac
.
uk
;
return
301
https
://$
server_name
$
request_uri
;
}
server
{
listen
443
ssl
;
listen
[::]:
443
ssl
;
server_name
mars
.
noc
.
ac
.
uk
;
ssl_certificate
/
etc
/
letsencrypt
/
live
/
mars
.
noc
.
ac
.
uk
/
fullchain
.
pem
;
ssl_certificate_key
/
etc
/
letsencrypt
/
live
/
mars
.
noc
.
ac
.
uk
/
privkey
.
pem
;
set
$
symfonyfile
"app"
;
set
$
symfonyroot
"/var/gliders/www"
;
set
$
symfonyenv
"prod"
;
root
$
symfonyroot
/
web
;
error_log
/
var
/
log
/
nginx
/
gliders
.
error
.
log
;
access_log
/
var
/
log
/
nginx
/$
symfonyenv
.
gliders
.
access
.
log
;
# Enable compression. Very helpful when we're getting stuff like
# large amounts of vehicle tracks in JSON form!
gzip
on
;
gzip_types
text
/
plain
application
/
xml
text
/
html
text
/
css
application
/
json
application
/
x
-
javascript
text
/
xml
text
/
javascript
application
/
javascript
;
# strip app.php/ prefix if it is present
rewrite
^/$
symfonyfile
\.
php
/?(.*)$ /$
1
permanent
;
location
/ {
limit_req
zone
=
gliders
burst
=
5
;
set
$
index_file
$
symfonyfile
".php"
;
if
(-
f
$
document_root
/.
maintenance
) {
return
503
;
}
index
$
index_file
;
try_files
$
uri
@
rewriteapp
;
}
location
/
mission
.
php
{
return
301
/
missions
;
}
location
/
glider
/
mission
.
php
{
return
301
/
missions
;
}
location
/
glider
{
return
301
/;
}
location
/
favicon
.
ico
{
return
404
;
access_log
off
;
error_log
off
;
}
error_page
413
/
413
.
html
;
error_page
502
/
502
.
html
;
error_page
504
/
504
.
html
;
error_page
503
@
maintenance
;
location
@
maintenance
{
rewrite
^(.*)$ /
maintenance
.
html
break
;
}
location
~ ^/(
images
|
fonts
|
css
|
js
) {
access_log
off
;
error_log
off
;
try_files
$
uri
=
404
;
expires
1
y
;
add_header
Cache
-
Control
"public"
;
}
location
~ ^/
images
/
vehicles
/(?
P
<
vehicle_type
>[
a
-
zA
-
Z0
-
9
]+)
_
(?
P
<
vehicle_name
>[
a
-
zA
-
Z0
-
9
]+)\.(
png
|
jpg
)$ {
access_log
off
;
error_log
off
;
try_files
$
uri
images
/
vehicles
/$
vehicle_name
.
png
=
404
;
}
location
/
static
/
logs
{
alias
/
var
/
gliders
/
logs
;
}
location
/
var
/
gliders
/
logs
{
alias
/
var
/
gliders
/
logs
;
}
location
/
static
{
alias
/
var
/
gliders
/
static
;
expires
1
d
;
add_header
Cache
-
Control
"public"
;
}
location
@
rewriteapp
{
rewrite
^(.*)$ /${
symfonyfile
}.
php
/$
1
last
;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location
~ ^/(
app
|
app_dev
|
config
)\.
php
(/|$) {
# fastcgi_pass hhvmfcgi;
fastcgi_pass
phpfcgi
;
fastcgi_intercept_errors
on
;
# error_page 502 = @fallback;
error_page
502
/
502
.
html
;
include
fastcgi_params
;
fastcgi_split_path_info
^(.+\.
php
)(/.*)$;
fastcgi_param
SCRIPT_FILENAME
$
symfonyroot
/
web
$
fastcgi_script_name
;
fastcgi_param
HTTPS
on
;
}
# location @fallback {
# fastcgi_pass phpfcgi;
# fastcgi_intercept_errors on;
# include fastcgi_params;
# fastcgi_split_path_info ^(.+\.php)(/.*)$;
# fastcgi_param SCRIPT_FILENAME $symfonyroot/web$fastcgi_script_name;
# fastcgi_param HTTPS off;
# error_page 502 /502.html;
#}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment