Article

Nginx Расчехляем Yii+Nginx; Yii+Nginx+Apache

# 0 /etc/hosts

127.0.0.1 my_test5.loc <a href="http://www.my_test5.loc">www.my_test5.loc</a>

Yii + Nginx

#1 /etc/nginx/sites-available/my_test5.loc

server {
    charset utf-8;
    client_max_body_size 128M;

    listen 80;
    
    server_name my_test5.loc;
    root        /var/www/my-project.loc/web;
    #root    /var/www/my-project.loc;
    index       index.php;

   location / {
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header Host $host;
  proxy_pass http://127.0.0.1:8080;
}

location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf|ttc|otf|eot|woff|woff2)$ {
#root        /var/www/my_test5.loc/web;  
try_files $uri $uri/;
}
}

# 2 файл с sites-available ОБЯЗАТЕЛЬНО должен иметь линк в sites-enabled
cd /etc/nginx/
ln -s sites-available/my-project sites-enabled/my-project
# 3 настраиваем Apache часть: приведен только код конфига, всё остальное взять с Apache + Nginx 

# /etc/apache2/sites-available/my-project.loc.conf
<VirtualHost *:8080>
    <Directory /var/www/my-project.loc>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All 
    Order allow,deny
    allow from all 
    </Directory>
    ServerAdmin admin@my-project.loc
    ServerName my-project.loc
    ServerAlias www.my-project.loc
    DocumentRoot /var/www/my-project.loc/web
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Third-party source 2

No data here

Dropdown
test 123