Skip to content

Add nginx configuration for Maho environment type - #122

Open
fballiano wants to merge 1 commit into
wardenenv:mainfrom
fballiano:add-maho-environment
Open

Add nginx configuration for Maho environment type#122
fballiano wants to merge 1 commit into
wardenenv:mainfrom
fballiano:add-maho-environment

Conversation

@fballiano

@fballiano fballiano commented Jul 20, 2026

Copy link
Copy Markdown

This adds the nginx vhost template for the new maho environment type submitted in wardenenv/warden#941.

Maho is an open source ecommerce platform forked from OpenMage / Magento 1 and modernized with PHP 8.3+ support. I am its maintainer.

The template is based on magento1.conf:

  • front controller routing to /index.php
  • the same php-fpm fastcgi block, including the X-Rewrite-Url / X-Original-Url header blanking inherited from Magento 1
  • commented MAGE_RUN_CODE / MAGE_RUN_TYPE params for multi-store setups (same convention as magento1.conf: the variables are not defined by the base server block, so they ship commented and users define and enable them per project when needed)

The /api routing follows Maho's public/.htaccess, which is the reference implementation:

  • /api/rest/v2/* to rest.php (modern REST API, Symfony API Platform)
  • /api/rest/* to api.php?type=rest (legacy Magento 1 REST, kept for compatibility)
  • /api/soap, /api/v2_soap, /api/xmlrpc, /api/jsonrpc to index.php (legacy protocol dispatchers)
  • any other /api/* (GraphQL, OpenAPI docs) to rest.php

Unlike Magento 1, Maho's webroot is the project's public/ directory (handled via NGINX_PUBLIC=/public in the environment definition), so the magento1.conf deny rules for app/, lib/, var/ etc. are not needed here: the application code lives outside the webroot. Deny rules for dotfiles and backup/config/source files are kept.

Verified by mounting this file into the published wardenenv/nginx:1.27 image with NGINX_TEMPLATE=maho.conf and NGINX_PUBLIC=/public, running the image's envsubst step and nginx -t (syntax ok, test successful).

Companion PRs:

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

Successfully merging this pull request may close these issues.

1 participant