Laradockを使用して、Laravel 5.5 をローカルで開発環境を構築しています。
.env
で
twitterのコールバックがhttpsと設定しています。
TWITTER_URL=https://test.abc.local/oauth/callback/twitter
Twitterでのログインでコールバックが nginx で https 通信がうまく行かず、404 Not Found
となります。
下記のように設定ファイルにsslを組み込んでましましたが、
何か間違っているでしょうか?
設定ファイル変更後に
docker-compose build nginx docker-compose stop nginx docker-compose up -d nginx
しています。
nginx/sites/default.conf
server { listen 80 default_server; #HTTPS listen 443 ssl; ## listen [::]:80 default_server ipv6only=on; server_name localhost; root /var/www/public; index index.php index.html index.htm; #HTTPS ssl_certificate /etc/nginx/ssl/localhost.crt; ssl_certificate_key /etc/nginx/ssl/localhost.key; ## location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ .php$ { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fixes timeouts fastcgi_read_timeout 600; include fastcgi_params; } location ~ /.ht { deny all; } location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } }
abc.conf
server { listen 80; listen [::]:80; server_name test.abc.local; root /var/www/abc/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ .php$ { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fixes timeouts fastcgi_read_timeout 600; include fastcgi_params; } location ~ /.ht { deny all; } location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } error_log /var/log/nginx/abc_error.log; access_log /var/log/nginx/abc_access.log; }
dockefile
FROM nginx:alpine LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>" COPY nginx.conf /etc/nginx/ # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. ARG CHANGE_SOURCE=false RUN if [ ${CHANGE_SOURCE} = true ]; then \ # Change application source from dl-cdn.alpinelinux.org to aliyun source sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \ ;fi RUN apk update \ && apk upgrade \ && apk add --no-cache bash \ ## HTTTPS && apk add --no-cache openssl \ ## && adduser -D -H -u 1000 -s /bin/bash www-data ARG PHP_UPSTREAM_CONTAINER=php-fpm ARG PHP_UPSTREAM_PORT=9000 # Set upstream conf and remove the default conf RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \ && rm /etc/nginx/conf.d/default.conf # HTTPS RUN mkdir /etc/nginx/ssl 2> /dev/null RUN openssl genrsa -out "/etc/nginx/ssl/localhost.key" 2048 \ && openssl req -new -key "/etc/nginx/ssl/localhost.key" -out "/etc/nginx/ssl/localhost.csr" -subj "/CN= localhost/O= localhost/C=UK" \ && openssl x509 -req -days 365 -in "/etc/nginx/ssl/localhost.csr" -signkey "/etc/nginx/ssl/localhost.key" -out "/etc/nginx/ssl/localhost.crt" ### CMD ["nginx"] EXPOSE 80 443
あなたの回答
tips
プレビュー