Skip to content

Commit be05a54

Browse files
authored
Merge branch 'master' into master
2 parents 55311ae + 949cd7c commit be05a54

File tree

7 files changed

+114
-24
lines changed

7 files changed

+114
-24
lines changed

.github/workflows/deploy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
echo "DOCS_INDEX_FOLLOW=1" >> $GITHUB_ENV
3535
- run: hypernode-deploy build -vvv
3636
- name: archive production artifacts
37-
uses: actions/upload-artifact@v3
37+
uses: actions/upload-artifact@v4
3838
with:
3939
name: deployment-build
4040
path: build/build.tgz
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
fetch-depth: 0
5555
- name: download build artifact
56-
uses: actions/download-artifact@v3
56+
uses: actions/download-artifact@v4
5757
with:
5858
name: deployment-build
5959
path: build/
@@ -106,7 +106,7 @@ jobs:
106106
steps:
107107
- uses: actions/checkout@v3
108108
- name: download build artifact
109-
uses: actions/download-artifact@v3
109+
uses: actions/download-artifact@v4
110110
with:
111111
name: deployment-build
112112
path: build/

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
11+
python-version: ['3.8', '3.9', '3.10', '3.11']
1212

1313
steps:
1414
- uses: actions/checkout@v3

docs/about-hypernode/security-policies/hypernode-security-statement.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ We currently run Hypernodes at several different hosting suppliers:
3030
- Datacenter certified with ISO 14001, ISO 27001, ISO 23301, and PCI-DSS
3131
- Amazon Web Services (AWS)
3232
- [ISO 9001](https://aws.amazon.com/compliance/iso-9001-faqs/), [ISO 27001](https://aws.amazon.com/compliance/iso-27001-faqs/), [ISO 27017](https://aws.amazon.com/compliance/iso-27017-faqs/), [ISO 27018](https://aws.amazon.com/compliance/iso-27018-faqs/), certified.
33-
- Datacenter certified with ISO 9001 and ISO 27001.
33+
- Datacenter certified with ISO 9001 and ISO 27001, and PCI-DSS
3434
- Dedicated (TBBM)
3535
- Both ISO 27001 and ISO 9001 certified.
36+
- Datacenter certified with ISO 9001, ISO 14001, ISO 27001, and PCI-DSS
3637

3738
## Infrastructure Hardening
3839

docs/ecommerce-applications/magento-2/how-to-configure-remote-storage-for-magento-2-x.md

Lines changed: 98 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This can be useful for many reasons, such as:
1616
- Offloading storage from your server, reducing the load on your server, and improving performance.
1717
- Allows you to make use of [horizontal scaling](../../hypernode-platform/autoscaling/how-does-horizontal-autoscaling-work), as you can easily add more servers without having to worry about syncing files between them.
1818
- Allows for effortless storage capacity scaling, as you can easily increase the storage capacity of your remote storage location.
19+
- **Note:** Staging ports (8888, 8443) will not be available when horizontal autoscaling is enabled.
1920
- Serving assets from a CDN, which can improve the performance of your website.
2021

2122
## Configuring the application
@@ -70,29 +71,109 @@ Magento's S3 implementation creates a test file called `storage.flag`, which is
7071

7172
## Serving assets from your S3 bucket
7273

73-
To start serving media assets from your S3 bucket, you need to make some adjustments to your nginx configuration.
74+
To start serving media assets from your S3 bucket, you need to make some adjustments to your nginx configuration. Create the following file at `/data/web/nginx/example.com/server.assets.conf` for each relevant vhost:
7475

7576
```nginx
76-
location /media {
77-
# ...
78-
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
79-
resolver 8.8.8.8;
80-
set $bucket "<my_bucket_name>";
81-
proxy_pass https://s3.amazonaws.com/$bucket$uri;
82-
proxy_pass_request_body off;
83-
proxy_pass_request_headers off;
84-
proxy_intercept_errors on;
85-
proxy_hide_header "x-amz-id-2";
86-
proxy_hide_header "x-amz-request-id";
87-
proxy_hide_header "x-amz-storage-class";
88-
proxy_hide_header "Set-Cookie";
89-
proxy_ignore_headers "Set-Cookie";
77+
set $backend "haproxy";
78+
79+
location @object_storage_fallback {
80+
# Proxy to object storage
81+
set $bucket "my_bucket_name";
82+
proxy_cache_key "$bucket$uri";
83+
proxy_cache_valid 200 302 7d;
84+
proxy_cache_methods GET HEAD;
85+
proxy_cache_background_update on;
86+
proxy_cache_use_stale updating;
87+
proxy_cache asset_cache;
88+
resolver 8.8.8.8;
89+
proxy_pass https://$bucket.s3.amazonaws.com$uri;
90+
proxy_pass_request_body off;
91+
proxy_pass_request_headers off;
92+
proxy_intercept_errors on;
93+
proxy_hide_header "x-amz-id-2";
94+
proxy_hide_header "x-amz-request-id";
95+
proxy_hide_header "x-amz-storage-class";
96+
proxy_hide_header "x-amz-server-side-encryption";
97+
proxy_hide_header "Set-Cookie";
98+
proxy_ignore_headers "Set-Cookie";
99+
add_header Cache-Control "public";
100+
add_header X-Frame-Options "SAMEORIGIN";
101+
add_header X-Cache-Status $upstream_cache_status;
102+
expires +1y;
103+
104+
# If object storage fails, fallback to PHP handler
105+
error_page 404 = @asset_fallback;
106+
error_page 403 = @asset_fallback;
107+
}
108+
109+
location @php_asset_fallback {
110+
# Handle with phpfpm
111+
rewrite ^/media /get.php?$args last;
112+
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
113+
echo_exec @phpfpm;
114+
}
115+
116+
location @haproxy {
117+
# Handle with haproxy
118+
include /etc/nginx/proxy_to_haproxy.conf;
119+
proxy_pass http://127.0.0.1:8080;
120+
}
121+
122+
location @asset_fallback {
123+
try_files "" $asset_fallback_handler;
124+
}
125+
126+
location ~ ^/static/ {
127+
expires max;
128+
129+
# Remove signature of the static files that is used to overcome the browser cache
130+
location ~ ^/static/version\d*/ {
131+
rewrite ^/static/version\d*/(.*)$ /static/$1 last;
132+
}
133+
134+
location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2|html|json|webmanifest)$ {
135+
add_header Cache-Control "public";
136+
add_header X-Frame-Options "SAMEORIGIN";
137+
expires +1y;
138+
139+
try_files $uri $uri/ @asset_fallback;
140+
}
141+
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
142+
add_header Cache-Control "no-store";
143+
add_header X-Frame-Options "SAMEORIGIN";
144+
expires off;
145+
146+
try_files $uri $uri/ @asset_fallback;
147+
}
148+
try_files $uri $uri/ @asset_fallback;
149+
add_header X-Frame-Options "SAMEORIGIN";
150+
}
151+
152+
location /media/ {
153+
try_files $uri $uri/ @asset_fallback;
154+
155+
location ~ ^/media/theme_customization/.*\.xml {
156+
deny all;
157+
}
158+
159+
location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|swf|eot|ttf|otf|woff|woff2)$ {
160+
add_header Cache-Control "public";
161+
add_header X-Frame-Options "SAMEORIGIN";
162+
expires +1y;
163+
try_files $uri $uri/ @object_storage_fallback;
164+
}
165+
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
166+
add_header Cache-Control "no-store";
167+
add_header X-Frame-Options "SAMEORIGIN";
168+
expires off;
169+
try_files $uri $uri/ @object_storage_fallback;
90170
}
91-
# ...
171+
add_header X-Frame-Options "SAMEORIGIN";
92172
}
93173
```
94174

95-
Also make sure your S3 bucket policies are configured correctly, so that only `/media` is publicly readable. For example:
175+
Make sure to change the string `my_bucket_name` to the name of your bucket and keep in mind that your bucket URL might be different depending on your AWS region. For example, you might need to change it from `https://$bucket.s3.amazonaws.com$uri` to `https://s3.amazonaws.com/$bucket$uri` instead.
176+
Furthermore, ensure that your S3 bucket policies are configured correctly, so that only `/media` is publicly readable. For example:
96177

97178
```json
98179
{

docs/hypernode-deploy/applications/config-for-magento-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ If you add these folders be aware that your new folders will be empty on your fi
7070
```
7171

7272
```php
73-
$configuration->addSharedFile('var/reports');
73+
$configuration->addSharedFolder('var/reports');
7474
```

docs/hypernode-platform/autoscaling/pricing-for-horizontal-autoscaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Horizontal autoscaling pricing has two parts.
1414

1515
## Fixed license
1616

17-
The fixed license costs 25 euros per month and is added to your normal Hypernode subscription when you enable Horizontal autoscaling. If you enable it in the middle of the month, you will only pay for the remaining days of that month accordingly.
17+
The fixed license costs 25 euros per month and is added to your normal Hypernode subscription when you enable Horizontal autoscaling.
1818

1919
## Variable Pricing Table
2020

docs/hypernode-platform/nginx/how-to-configure-nginx-for-a-multistore.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ You'd have to prefix the file with `varnish` instead of `server`, like `varnish.
4242
This way these multistore requests will go through varnish and will then be rewritten accordingly with the `varnish.storecode` configuration.
4343
```
4444

45+
### Use a different Store Type
46+
47+
Magento uses a default store type of `store`, you can change this to `website` too if this better fits your need, more information about this can be found on `MAGE_RUN_TYPE` in [the Magento 2 official documentation](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-overview).
48+
49+
```nginx
50+
set $storetype "store";
51+
```
52+
4553
### Using Subdirectories
4654

4755
Another option is to use subdirectories instead. Once you have added the required vhost you need to add a `server.storecode` file to the specific vhost directory (`/data/web/nginx/example.com/`) with the following content:

0 commit comments

Comments
 (0)