Localhost在Nginx上重定向我的网站magento 2

时间:2019-02-26 16:04:14

标签: nginx magento2

hi
,当我输入http://localhost时,我的本地重定向我的域magento 2,就像这样 Localhost->my domain ( trainingtraing.com)
我测试:
本地主机重定向我的域
本地主机/ phpmyadmin->我的域
mydomain(trainingtraining.com)->成功
mydomain.com:8080->本地主机Picture
mydomain.com:8080/phpmyadmin-> localhost / phpmyadmin Pic
localhost:8080->成功
localhost:8080 / phpmyadmin->成功
所以我尝试将端口更改为80,但不起作用。谢谢大家! ^ _ ^
文件等/主机:

127.0.0.1   localhost
127.0.1.1   wightman
127.0.0.1   trainingtraining.com
0.0.0.0     account.jetbrains.com

文件配置nginx etc / nginx / conf.d / default.conf(8080)

server {
  listen 8080;
  listen [::]:8080;
  server_name 127.0.0.1;
  root /usr/share/nginx/html/;
  index index.php index.html index.htm index.nginx-debian.html; 
  location / {
    try_files $uri $uri/ =404;
  }

文件etc / nginx / sites-available / default

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;  
    server_name 127.0.0.1;

文件etc / nginx / sites-availabel / trainingtraing(我的网站)

upstream fastcgi_backend {
server  unix:/run/php/php7.2-fpm.sock;
}
server {
    listen 80;
    server_name trainingtraining.com;    
    set $MAGE_ROOT /var/www/html/trainingtraining;
    set $MAGE_MODE developer;    
    root /var/www/html/trainingtraining/pub;    
    index index.php;
    autoindex off;
    charset UTF-8;
    error_page 404 403 = /errors/404.php;     
    location ~* ^/setup($|/) {
        root $MAGE_ROOT;
        location ~ ^/setup/index.php {
            fastcgi_pass   fastcgi_backend;

            fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
            fastcgi_param  PHP_VALUE "memory_limit=768M \n max_execution_time=600";
            fastcgi_read_timeout 600s;
            fastcgi_connect_timeout 600s;   
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }   
        location ~ ^/setup/(?!pub/). {
            deny all;
        }    
        location ~ ^/setup/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }

我使用过的过滤etc / php / 7.2 / fpm / pool.d / www.conf:
用户=管理员
组=管理员

listen.owner = www-data
listen.group = www-data

0 个答案:

没有答案