Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
sysadmin
/
acme-ssl
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 660be5af
authored
Nov 17, 2016
by
Никита Миропольский
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
более корректный пример
1 parent
fd8a8226
Pipeline
#1985
for
660be5af
skipped
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
19 deletions
nginx.conf
nginx.conf
View file @
660be5a
server
{
# слушаем порты и настраиваем SSL:
listen
80
;
listen
443
ssl
;
listen
80
;
server_name
ggg.ashmanov.com
;
server_tokens
off
;
# сертификаты для сервера
ssl_certificate
/var/cache/acme/site.crt
;
ssl_certificate_key
/var/cache/acme/site.key
;
access_log
/var/log/nginx/gitlab_access.log
;
error_log
/var/log/nginx/gitlab_error.log
;
# простейшая защита от XSS
add_header
X-XSS-Protection
"1
;
mode=block"
;
add_header
X-Content-Type-Options
nosniff
;
add_header
X-Frame-Options
DENY
;
# запросы acme-challenge
location
~
^/\.well-known/acme-challenge/([a-zA-Z0-9_-]*)$
{
# запросы acme-challenge
location
~
^/\.well-known/acme-challenge/([a-zA-Z0-9_-]*)$
{
default_type
"text/plain"
;
alias
/var/cache/acme/challenges/
$1
;
}
}
# остальные запросы
location
/
{
return
301
https://
$server_name$request_uri
;
}
}
server
{
listen
443
ssl
;
server_name
ggg.ashmanov.com
;
server_tokens
off
;
access_log
/var/log/nginx/gitlab_ssl_access.log
;
error_log
/var/log/nginx/gitlab_ssl_error.log
;
ssl_certificate
/var/cache/acme/site.crt
;
ssl_certificate_key
/var/cache/acme/site.key
;
# простейшая защита от XSS
add_header
X-XSS-Protection
"1
;
mode=block"
;
add_header
X-Content-Type-Options
nosniff
;
add_header
X-Frame-Options
DENY
;
if
(
$http_host
!=
$server_name
)
{
return
301
https://
$server_name$request_uri
;
}
# редирект на https
if
(
$scheme
!=
https)
{
rewrite
^
https://
$http_host$request_uri
permanent
;
}
}
include
gitlab.conf
;
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment