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
aa8e609f
Commit
aa8e609f
authored
9 years ago
by
Owain Jones
Browse files
Options
Download
Email Patches
Plain Diff
update for symfony framework
parent
d896742e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
23 deletions
+65
-23
gliders.nginx.conf
gliders.nginx.conf
+65
-23
No files found.
gliders.nginx.conf
View file @
aa8e609f
# Configuration for the gliders website -- set it up to use php-fpm etc.
# 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 PHP files with
# sensitive data like passwords inside them.
upstream
phpfcgi
{
server
unix
:/
var
/
run
/
php5
-
fpm
.
sock
;
#for PHP-FPM running on UNIX socket
}
server
{
listen
80
;
listen
8080
;
root
/
home
/
gliders
/
www
;
index
index
.
php
index
.
html
index
.
htm
;
server_name
_
;
# update with actual hostname when we get it
location
/ {
try_files
$
uri
$
uri
/ /
index
.
html
;
}
server_name
*.
gliders
.
vm
;
root
/
home
/
gliders
/
web
;
error_
page
404
/
404
.
html
;
error_page
500
502
503
504
/
50
x
.
html
;
error_
log
/
var
/
log
/
nginx
/
gliders
.
error
.
log
;
access_log
/
var
/
log
/
nginx
/
gliders
.
access
.
log
;
#
Serve static files directly
location
~* \.(
png
|
jpe
?
g
|
gif
|
ico
)$ {
expires
1
y
;
access_log
off
;
try_files
$
uri
$
uri
/ @
rewrite
;
gzip
off
;
#
strip app.php/ prefix if it is present
rewrite
^/
app
\.
php
/?(.*)$ /$
1
permanent
;
location
/ {
index
app
.
php
;
try_files
$
uri
@
rewriteapp
;
}
location
~* \.(
css
|
js
)$ {
expires
1
d
;
access_log
off
;
location
@
rewriteapp
{
rewrite
^(.*)$ /
app
.
php
/$
1
last
;
}
location
~ \.
php
$ {
try_files
$
uri
=
404
;
fastcgi_pass
unix
:/
var
/
run
/
php5
-
fpm
.
sock
;
fastcgi_index
index
.
php
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location
~ ^/(
app
|
app_dev
|
config
)\.
php
(/|$) {
fastcgi_pass
phpfcgi
;
fastcgi_split_path_info
^(.+\.
php
)(/.*)$;
include
fastcgi_params
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
fastcgi_param
HTTPS
off
;
}
}
# We don't yet have an SSL cert (not like a VM on my own machine needs one...)
# server {
# listen 443;
#
# server_name *.gliders.vm;
# root /home/gliders/web;
#
# ssl on;
# ssl_certificate /etc/ssl/certs/symfony2.crt;
# ssl_certificate_key /etc/ssl/private/symfony2.key;
#
# error_log /var/log/nginx/symfony2.error.log;
# access_log /var/log/nginx/symfony2.access.log;
#
# # strip app.php/ prefix if it is present
# rewrite ^/app\.php/?(.*)$ /$1 permanent;
#
# location / {
# index app.php;
# try_files $uri @rewriteapp;
# }
#
# location @rewriteapp {
# rewrite ^(.*)$ /app.php/$1 last;
# }
#
# # pass the PHP scripts to FastCGI server from upstream phpfcgi
# location ~ ^/(app|app_dev|config)\.php(/|$) {
# fastcgi_pass phpfcgi;
# fastcgi_split_path_info ^(.+\.php)(/.*)$;
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param HTTPS on;
# }
#
}
\ No newline at end of file
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