Nginx + Passenger: Cache 404 urls Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!What should my Nginx rewrite rules be for Rails with Passenger for page caching in a subdirectory?Nginx with Passenger setup problemsnginx custom 404 error page for virtual hostPass on passenger_base_uri to Rails appNginx gives 404 error for rails app except the rootUsing nginx try_files and custom error pages for the main location block?with nginx change url being sent to passengertry_files serving fall back before previous conditionNGINX virtual host config for Magento2 in a subfoldernginx/Passenger: Serving up a cached file only if a parameter is not in request
How fail-safe is nr as stop bytes?
How can I reduce the gap between left and right of cdot with a macro?
Project Euler #1 in C++
An adverb for when you're not exaggerating
How much damage would a cupful of neutron star matter do to the Earth?
What is "gratricide"?
Is it a good idea to use CNN to classify 1D signal?
If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?
Question about debouncing - delay of state change
What are the diatonic extended chords of C major?
How would a mousetrap for use in space work?
Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?
How could we fake a moon landing now?
Disembodied hand growing fangs
Is there hard evidence that the grant peer review system performs significantly better than random?
What is this clumpy 20-30cm high yellow-flowered plant?
Is it possible for SQL statements to execute concurrently within a single session in SQL Server?
Did Deadpool rescue all of the X-Force?
Time to Settle Down!
Why do we need to use the builder design pattern when we can do the same thing with setters?
Effects on objects due to a brief relocation of massive amounts of mass
How often does castling occur in grandmaster games?
Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode
Amount of permutations on an NxNxN Rubik's Cube
Nginx + Passenger: Cache 404 urls
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!What should my Nginx rewrite rules be for Rails with Passenger for page caching in a subdirectory?Nginx with Passenger setup problemsnginx custom 404 error page for virtual hostPass on passenger_base_uri to Rails appNginx gives 404 error for rails app except the rootUsing nginx try_files and custom error pages for the main location block?with nginx change url being sent to passengertry_files serving fall back before previous conditionNGINX virtual host config for Magento2 in a subfoldernginx/Passenger: Serving up a cached file only if a parameter is not in request
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Context
I have a Rails app with a nginx server and Passenger.
The app is dynamically generating pages based from the request url: if the url exists in the database the app renders the corresponding page. Or if the url does not exist in the database the app renders a 404 page.
Problem
Many crawlers are trying to find vulnerabilities and request lots of urls (.git, admin/config.php, wp-login.php etc...)
Each of those requests are reaching the Rails app, which is generating hits in the database.
Solution
I am looking for a way to do this:
- first time a "non existent" url if requested it goes through the Rails app, which responds with a 404
- nginx caches and remember this url
- next time the same url is requested, nginx directly respond with 404 status without going through the Rails app
Also when the Rails app is restarted (through Passenger) this cache should be purged.
Tries
- I tried to add
fastcgi_cache_valid 404 10m;
in the server block, it's not working. - Also tried
proxy_cache_valid 404 10m;
As you may guess I'm new to nginx.
Thanks for your help.
Nginx config
server
listen ...;
server_name ...;
root /path/to/rails/app;
error_page 404 /404;
error_page 500 502 503 504 /500;
# First I tried this, no success so I removed it
fastcgi_cache_valid 404 10m;
# Then I tried this, no success so I removed it also
proxy_cache_valid 404 10m;
location /
gzip_static on;
etag off;
charset utf-8;
add_header Cache-Control "max-age=0, private, must-revalidate";
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options deny;
add_header X-XSS-Protection "1; mode=block";
location = /
try_files /cached/index.html @rails;
location /
try_files /cached$uri.html /cached$uri $uri @rails;
location @rails
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
nginx cache ruby-on-rails phusion-passenger http-status-code-404
New contributor
|
show 1 more comment
Context
I have a Rails app with a nginx server and Passenger.
The app is dynamically generating pages based from the request url: if the url exists in the database the app renders the corresponding page. Or if the url does not exist in the database the app renders a 404 page.
Problem
Many crawlers are trying to find vulnerabilities and request lots of urls (.git, admin/config.php, wp-login.php etc...)
Each of those requests are reaching the Rails app, which is generating hits in the database.
Solution
I am looking for a way to do this:
- first time a "non existent" url if requested it goes through the Rails app, which responds with a 404
- nginx caches and remember this url
- next time the same url is requested, nginx directly respond with 404 status without going through the Rails app
Also when the Rails app is restarted (through Passenger) this cache should be purged.
Tries
- I tried to add
fastcgi_cache_valid 404 10m;
in the server block, it's not working. - Also tried
proxy_cache_valid 404 10m;
As you may guess I'm new to nginx.
Thanks for your help.
Nginx config
server
listen ...;
server_name ...;
root /path/to/rails/app;
error_page 404 /404;
error_page 500 502 503 504 /500;
# First I tried this, no success so I removed it
fastcgi_cache_valid 404 10m;
# Then I tried this, no success so I removed it also
proxy_cache_valid 404 10m;
location /
gzip_static on;
etag off;
charset utf-8;
add_header Cache-Control "max-age=0, private, must-revalidate";
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options deny;
add_header X-XSS-Protection "1; mode=block";
location = /
try_files /cached/index.html @rails;
location /
try_files /cached$uri.html /cached$uri $uri @rails;
location @rails
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
nginx cache ruby-on-rails phusion-passenger http-status-code-404
New contributor
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
@MichaelHampton added
– Benj
Apr 13 at 17:34
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago
|
show 1 more comment
Context
I have a Rails app with a nginx server and Passenger.
The app is dynamically generating pages based from the request url: if the url exists in the database the app renders the corresponding page. Or if the url does not exist in the database the app renders a 404 page.
Problem
Many crawlers are trying to find vulnerabilities and request lots of urls (.git, admin/config.php, wp-login.php etc...)
Each of those requests are reaching the Rails app, which is generating hits in the database.
Solution
I am looking for a way to do this:
- first time a "non existent" url if requested it goes through the Rails app, which responds with a 404
- nginx caches and remember this url
- next time the same url is requested, nginx directly respond with 404 status without going through the Rails app
Also when the Rails app is restarted (through Passenger) this cache should be purged.
Tries
- I tried to add
fastcgi_cache_valid 404 10m;
in the server block, it's not working. - Also tried
proxy_cache_valid 404 10m;
As you may guess I'm new to nginx.
Thanks for your help.
Nginx config
server
listen ...;
server_name ...;
root /path/to/rails/app;
error_page 404 /404;
error_page 500 502 503 504 /500;
# First I tried this, no success so I removed it
fastcgi_cache_valid 404 10m;
# Then I tried this, no success so I removed it also
proxy_cache_valid 404 10m;
location /
gzip_static on;
etag off;
charset utf-8;
add_header Cache-Control "max-age=0, private, must-revalidate";
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options deny;
add_header X-XSS-Protection "1; mode=block";
location = /
try_files /cached/index.html @rails;
location /
try_files /cached$uri.html /cached$uri $uri @rails;
location @rails
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
nginx cache ruby-on-rails phusion-passenger http-status-code-404
New contributor
Context
I have a Rails app with a nginx server and Passenger.
The app is dynamically generating pages based from the request url: if the url exists in the database the app renders the corresponding page. Or if the url does not exist in the database the app renders a 404 page.
Problem
Many crawlers are trying to find vulnerabilities and request lots of urls (.git, admin/config.php, wp-login.php etc...)
Each of those requests are reaching the Rails app, which is generating hits in the database.
Solution
I am looking for a way to do this:
- first time a "non existent" url if requested it goes through the Rails app, which responds with a 404
- nginx caches and remember this url
- next time the same url is requested, nginx directly respond with 404 status without going through the Rails app
Also when the Rails app is restarted (through Passenger) this cache should be purged.
Tries
- I tried to add
fastcgi_cache_valid 404 10m;
in the server block, it's not working. - Also tried
proxy_cache_valid 404 10m;
As you may guess I'm new to nginx.
Thanks for your help.
Nginx config
server
listen ...;
server_name ...;
root /path/to/rails/app;
error_page 404 /404;
error_page 500 502 503 504 /500;
# First I tried this, no success so I removed it
fastcgi_cache_valid 404 10m;
# Then I tried this, no success so I removed it also
proxy_cache_valid 404 10m;
location /
gzip_static on;
etag off;
charset utf-8;
add_header Cache-Control "max-age=0, private, must-revalidate";
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options deny;
add_header X-XSS-Protection "1; mode=block";
location = /
try_files /cached/index.html @rails;
location /
try_files /cached$uri.html /cached$uri $uri @rails;
location @rails
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
nginx cache ruby-on-rails phusion-passenger http-status-code-404
nginx cache ruby-on-rails phusion-passenger http-status-code-404
New contributor
New contributor
edited 2 days ago
Benj
New contributor
asked Apr 13 at 7:57
BenjBenj
534
534
New contributor
New contributor
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
@MichaelHampton added
– Benj
Apr 13 at 17:34
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago
|
show 1 more comment
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
@MichaelHampton added
– Benj
Apr 13 at 17:34
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
@MichaelHampton added
– Benj
Apr 13 at 17:34
@MichaelHampton added
– Benj
Apr 13 at 17:34
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago
|
show 1 more comment
1 Answer
1
active
oldest
votes
I'm most familiar with caching in a reverse proxy environment, so that is the approach I'd take. Thankfully, Nginx is able to proxy for itself fairly easily:
# define your cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=cacheName:[metaDataSize] max_size=[maxCacheSize] inactive=60m use_temp_path=off;
http
server
# Any TLS, caching, or gzipping on this virtual server
listen ...;
server_name [Actual Domain];
location /
proxy_pass http://127.0.0.1:80;
proxy_set_header Host [domain.passenger];
# Activate and configure caching here
proxy_cache cacheName;
proxy_cache_valid 404 10m;
...any other proxy settings you want.
# Forward original request info
proxy_set_header X-Original-Host $http_host;
proxy_set_header X-Original-Scheme $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Gzip if you want
gzip on;
gzip_proxied any;
...etc
server
# Any Rails/Passenger configuration on this virtual server
listen 80;
server_name [domain.passenger];
# Don't log requests twice
access_log off;
# Only allow local requests
allow 127.0.0.1;
deny all;
location /
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
Purging the cache just requires running rm -rf /path/to/cache/*
, so you could script that into your Rails restart procedures in whatever way pleases you best.
That's clever. I will try this. Thanks
– Benj
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Benj is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962893%2fnginx-passenger-cache-404-urls%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm most familiar with caching in a reverse proxy environment, so that is the approach I'd take. Thankfully, Nginx is able to proxy for itself fairly easily:
# define your cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=cacheName:[metaDataSize] max_size=[maxCacheSize] inactive=60m use_temp_path=off;
http
server
# Any TLS, caching, or gzipping on this virtual server
listen ...;
server_name [Actual Domain];
location /
proxy_pass http://127.0.0.1:80;
proxy_set_header Host [domain.passenger];
# Activate and configure caching here
proxy_cache cacheName;
proxy_cache_valid 404 10m;
...any other proxy settings you want.
# Forward original request info
proxy_set_header X-Original-Host $http_host;
proxy_set_header X-Original-Scheme $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Gzip if you want
gzip on;
gzip_proxied any;
...etc
server
# Any Rails/Passenger configuration on this virtual server
listen 80;
server_name [domain.passenger];
# Don't log requests twice
access_log off;
# Only allow local requests
allow 127.0.0.1;
deny all;
location /
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
Purging the cache just requires running rm -rf /path/to/cache/*
, so you could script that into your Rails restart procedures in whatever way pleases you best.
That's clever. I will try this. Thanks
– Benj
yesterday
add a comment |
I'm most familiar with caching in a reverse proxy environment, so that is the approach I'd take. Thankfully, Nginx is able to proxy for itself fairly easily:
# define your cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=cacheName:[metaDataSize] max_size=[maxCacheSize] inactive=60m use_temp_path=off;
http
server
# Any TLS, caching, or gzipping on this virtual server
listen ...;
server_name [Actual Domain];
location /
proxy_pass http://127.0.0.1:80;
proxy_set_header Host [domain.passenger];
# Activate and configure caching here
proxy_cache cacheName;
proxy_cache_valid 404 10m;
...any other proxy settings you want.
# Forward original request info
proxy_set_header X-Original-Host $http_host;
proxy_set_header X-Original-Scheme $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Gzip if you want
gzip on;
gzip_proxied any;
...etc
server
# Any Rails/Passenger configuration on this virtual server
listen 80;
server_name [domain.passenger];
# Don't log requests twice
access_log off;
# Only allow local requests
allow 127.0.0.1;
deny all;
location /
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
Purging the cache just requires running rm -rf /path/to/cache/*
, so you could script that into your Rails restart procedures in whatever way pleases you best.
That's clever. I will try this. Thanks
– Benj
yesterday
add a comment |
I'm most familiar with caching in a reverse proxy environment, so that is the approach I'd take. Thankfully, Nginx is able to proxy for itself fairly easily:
# define your cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=cacheName:[metaDataSize] max_size=[maxCacheSize] inactive=60m use_temp_path=off;
http
server
# Any TLS, caching, or gzipping on this virtual server
listen ...;
server_name [Actual Domain];
location /
proxy_pass http://127.0.0.1:80;
proxy_set_header Host [domain.passenger];
# Activate and configure caching here
proxy_cache cacheName;
proxy_cache_valid 404 10m;
...any other proxy settings you want.
# Forward original request info
proxy_set_header X-Original-Host $http_host;
proxy_set_header X-Original-Scheme $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Gzip if you want
gzip on;
gzip_proxied any;
...etc
server
# Any Rails/Passenger configuration on this virtual server
listen 80;
server_name [domain.passenger];
# Don't log requests twice
access_log off;
# Only allow local requests
allow 127.0.0.1;
deny all;
location /
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
Purging the cache just requires running rm -rf /path/to/cache/*
, so you could script that into your Rails restart procedures in whatever way pleases you best.
I'm most familiar with caching in a reverse proxy environment, so that is the approach I'd take. Thankfully, Nginx is able to proxy for itself fairly easily:
# define your cache
proxy_cache_path /path/to/cache levels=1:2 keys_zone=cacheName:[metaDataSize] max_size=[maxCacheSize] inactive=60m use_temp_path=off;
http
server
# Any TLS, caching, or gzipping on this virtual server
listen ...;
server_name [Actual Domain];
location /
proxy_pass http://127.0.0.1:80;
proxy_set_header Host [domain.passenger];
# Activate and configure caching here
proxy_cache cacheName;
proxy_cache_valid 404 10m;
...any other proxy settings you want.
# Forward original request info
proxy_set_header X-Original-Host $http_host;
proxy_set_header X-Original-Scheme $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
# Gzip if you want
gzip on;
gzip_proxied any;
...etc
server
# Any Rails/Passenger configuration on this virtual server
listen 80;
server_name [domain.passenger];
# Don't log requests twice
access_log off;
# Only allow local requests
allow 127.0.0.1;
deny all;
location /
passenger_enabled on;
passenger_ruby /path/to/ruby;
passenger_app_env production;
Purging the cache just requires running rm -rf /path/to/cache/*
, so you could script that into your Rails restart procedures in whatever way pleases you best.
edited yesterday
answered yesterday
Brian BaumanBrian Bauman
13818
13818
That's clever. I will try this. Thanks
– Benj
yesterday
add a comment |
That's clever. I will try this. Thanks
– Benj
yesterday
That's clever. I will try this. Thanks
– Benj
yesterday
That's clever. I will try this. Thanks
– Benj
yesterday
add a comment |
Benj is a new contributor. Be nice, and check out our Code of Conduct.
Benj is a new contributor. Be nice, and check out our Code of Conduct.
Benj is a new contributor. Be nice, and check out our Code of Conduct.
Benj is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962893%2fnginx-passenger-cache-404-urls%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please show your nginx caching configuration.
– Michael Hampton♦
Apr 13 at 14:53
@MichaelHampton added
– Benj
Apr 13 at 17:34
You do not appear to have configured nginx to do any caching. Rather it appears to be serving static files generated by your application.
– Michael Hampton♦
Apr 13 at 17:57
That's correct. The app is generating the pages once and generate static html, then nxing serves the static html file. Would you point me to the right direction on how to configure caching?
– Benj
Apr 14 at 3:38
Is there a reason you aren't using Nginx as a caching reverse proxy to your Rails server? If such a solution is acceptable to you, I can write one up.
– Brian Bauman
2 days ago