server {
    listen 8080 default_server;
    listen [::]:8080;

    server_name _;

    root /var/www/html/web_weiniuyun/web;

    index index.php index.html index.htm index.nginx-debian.html;

    location / {
        try_files $uri $uri/ @rewrite;
    }

    location @rewrite {
        rewrite ^/goods-(.*)\.html$ /index.php?s=goods-$1.html last;
        rewrite ^/(.*)$ /index.php?s=$1 last;
    }

    location ~ ^/index.php/(.*)$ {
        if ($request_method = POST) {
            rewrite ^/index.php/(.*)$ /index.php?s=$1 last;
            break;
        }
        rewrite ^/index.php/(.*)$ /index.php?s=$1 permanent;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }
}
