LINUX.ORG.RU

scm-server nginx basic auth

 , ,


1

1

установил scm-server и запустил на 8080 порту, поставил nginx и сделал проксирование на 8080 и добавил basic auth

server {
        listen 80;
        server_name git.example.com;

        location / {
                auth_basic            "Private Area";
                auth_basic_user_file  /etc/nginx/.scm_htpasswd;
                satisfy  any;

                proxy_set_header X-Real-IP         $remote_addr;
                proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_pass       http://localhost:8080;
        }

}
в firefox такой проблемы нет

при переходе через google chrome на http://git.example.com запрашивается логин и пароль basic auth, после чего ввожу логин и пароль уже от scm-server, но потом у меня опять выскакивает окно basic auth, почему так? в логе nginx

77.**.**.** - - [11/Nov/2016:17:08:01 +0100] "GET /scm HTTP/1.1" 401 597 "http://git.example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:46 +0100] "GET /scm HTTP/1.1" 302 0 "http://git.example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:46 +0100] "GET /scm/ HTTP/1.1" 200 4941 "http://git.example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:47 +0100] "GET /scm/plugins/resources/js/93d871299eb3454e3d49605370ffa8800fafba1b.js HTTP/1.1" 200 5059 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:47 +0100] "GET /scm/resources/moment/lang/ru.js HTTP/1.1" 404 1396 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:47 +0100] "GET /scm/resources/extjs/i18n/ext-lang-ru.js HTTP/1.1" 404 1404 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:47 +0100] "GET /scm/resources/js/i18n/ru.js HTTP/1.1" 404 1392 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:50 +0100] "GET /scm/resources/moment/lang/ru.js HTTP/1.1" 404 1396 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:50 +0100] "GET /scm/resources/extjs/i18n/ext-lang-ru.js HTTP/1.1" 404 1404 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:50 +0100] "GET /scm/resources/js/i18n/ru.js HTTP/1.1" 404 1392 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - example [11/Nov/2016:17:09:51 +0100] "GET /scm/api/rest/authentication/state.json?_dc=1478880593199 HTTP/1.1" 401 0 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"
77.**.**.** - - [11/Nov/2016:17:10:22 +0100] "POST /scm/api/rest/authentication/login.json HTTP/1.1" 401 597 "http://git.example.com/scm/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" "-"


добавил basic auth

Зачем?
btw, что такое «scm-server»?

thesis ★★★★★ ()
Ответ на: комментарий от Garcia

почему-то идет два запроса на авторизацию в chrome

77.*.*.* - - [15/Nov/2016:10:19:59 +0100] "GET /scm HTTP/1.1" 401 606 "http://example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
77.*.*.* - - [15/Nov/2016:10:19:59 +0100] "GET /scm HTTP/1.1" 401 606 "http://example.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
хотя через firefox идет один запрос
77.*.*.* - - [15/Nov/2016:10:36:52 +0100] "GET / HTTP/1.1" 401 204 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0"

Garcia ()
Ответ на: комментарий от bdfy

открывал все браузеры через окно режим инкогнито, fail2ban не стоит, надо через nginx

Garcia ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.