Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx Configuration file #36

Open
jessicana opened this issue Apr 7, 2023 · 2 comments
Open

Nginx Configuration file #36

jessicana opened this issue Apr 7, 2023 · 2 comments

Comments

@jessicana
Copy link

Is there any nginx configuration file example?

@jessicana
Copy link
Author

The example here does not work with osCommerce-v4
https://www.nginx.com/resources/wiki/start/topics/recipes/oscommerce/

@codehog
Copy link

codehog commented Apr 9, 2023

This should be enough to get you started until an official version is made available.
You'll need to set the server_name and also the fastcgi_pass parameters to suit your setup. Additionally, if you add a new sales channel using the OSC admin you will need to add a new section to this config.

server {

    set $yii_bootstrap "index.php";

    server_name 192.168.1.70;
    root        /var/www/html;
    index       $yii_bootstrap;

    access_log  /var/log/nginx/access.log;
    error_log   /var/log/nginx/error.log;

    client_max_body_size 50m;
    charset utf-8;

    location /furniture {
        index $yii_bootstrap;
        try_files $uri $uri/ /furniture/$yii_bootstrap?$args;
    }

    location /printshop {
        index $yii_bootstrap;
        try_files $uri $uri/ /printshop/$yii_bootstrap?$args;
    }

    location /admin {
        index $yii_bootstrap;
        try_files $uri $uri/ /admin/$yii_bootstrap?$args;
    }

    location /b2b-supermarket {
        index $yii_bootstrap;
        try_files $uri $uri/ /b2b-supermarket/$yii_bootstrap?$args;
    }

    location /watch {
        index $yii_bootstrap;
        try_files $uri $uri/ /watch/$yii_bootstrap?$args;
    }

    location / {
        index $yii_bootstrap;
    }

    location ~ \.php$ {

        if (!-f $request_filename) { return 404; }
        include fastcgi_params;

        fastcgi_pass php:9000;
        fastcgi_index $yii_bootstrap;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;

    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants