yii2: Do not work any redirect in docker
What steps will reproduce the problem?
- install docker CE
- build image and up it:
docker-compose.yml
version: '2'
services:
php:
#image: php:7.1-apache
build: ./php-apache2
volumes:
- ./:/var/www/html/
- ./apache_conf:/etc/apache2/sites-enabled/
ports:
- "8080:8080"
Dockerfile
FROM php:7.1-apache
RUN a2enmod rewrite
#Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
RUN apt-get update && apt-get install -y \
apt-transport-https \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update
#Install Dependencies
RUN ACCEPT_EULA=Y apt-get install -y \
unixodbc \
unixodbc-dev \
libgss3 \
odbcinst \
msodbcsql \
locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
#Install PHP extensions
RUN pecl install \
pdo_sqlsrv-4.3.0 \
sqlsrv-4.3.0 \
&& docker-php-ext-install \
pdo \
pdo_mysql \
&& docker-php-ext-enable \
pdo_sqlsrv \
sqlsrv
virtualhost config
Listen 8080
<VirtualHost *:8080>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/frontend/web/
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Set up rewrites so that all requests go to index.php
RewriteEngine on
</VirtualHost>
- download and install yii2 advance
- try any redirect
What is the expected result?
Redirect
What do you get instead?
Nothing Redirect do not work
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.12 |
| PHP version | 7.1 |
| Operating system | debian 9 |
| Web server | Apache2 |
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 28 (17 by maintainers)
I’ve tried config from the first post with some adjustments:
In this environment redirect works exactly as it should, so I’m closing the issue.