Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
b230d205
Commit
b230d205
authored
7 years ago
by
FORESTIER Fabien
Browse files
Options
Downloads
Patches
Plain Diff
Improve nginx routing
parent
5f27e167
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker-compose-staging.yml
+2
-2
2 additions, 2 deletions
docker-compose-staging.yml
webapp-nginx.conf
+26
-22
26 additions, 22 deletions
webapp-nginx.conf
with
28 additions
and
24 deletions
docker-compose-staging.yml
+
2
−
2
View file @
b230d205
...
...
@@ -2,8 +2,8 @@ version: "2"
services
:
node-server
:
build
:
./webapp
#
node-server:
#
build: ./webapp
proxy-elasticsearch
:
image
:
nginx
...
...
This diff is collapsed.
Click to expand it.
webapp-nginx.conf
+
26
−
22
View file @
b230d205
...
...
@@ -2,30 +2,34 @@
server
{
listen
8080
;
server_name
portail
-
data
;
root
/
usr
/
share
/
nginx
/
html
;
root
/
usr
/
share
/
nginx
/
html
/
;
location
= / {
rewrite_by_lua
'
for
lang
in
(
ngx
.
var
.
http_accept_language
..
","
):
gmatch
(
"([^,]*),"
)
do
if
string
.
sub
(
lang
,
0
,
2
) ==
"en"
then
ngx
.
redirect
(
"/en/"
)
end
if
string
.
sub
(
lang
,
0
,
2
) ==
"fr"
then
ngx
.
redirect
(
"/fr/"
)
end
end
ngx
.
redirect
(
"/en/"
)
'
;
#rewrite ^/$ /en/ permanent;
location
= / {
rewrite_by_lua
'
for
lang
in
(
ngx
.
var
.
http_accept_language
..
","
):
gmatch
(
"([^,]*),"
)
do
if
string
.
sub
(
lang
,
0
,
2
) ==
"en"
then
ngx
.
redirect
(
"/en/"
)
end
if
string
.
sub
(
lang
,
0
,
2
) ==
"fr"
then
ngx
.
redirect
(
"/fr/"
)
end
end
ngx
.
redirect
(
"/en/"
)
'
;
#rewrite ^/$ /en/ permanent;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
error_page
404
= @
notfound
;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location
@
notfound
{
return
301
/;
location
/
en
/
{
try_files
$
uri
$
args
$
uri
/ /
en
/
index
.
html
;
}
location
/
fr
/ {
try_files
$
uri
$
args
$
uri
/ /
fr
/
index
.
html
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment