Dancer2
view release on metacpan or search on metacpan
lib/Dancer2/Manual/Deployment.pod view on Meta::CPAN
Hereâs a basic NGINX configuration for a Dancer2 app running on Starman:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Start NGINX and Starman, and your app will be accessible through the proxy.
=head2 Example: Using NGINX with uWSGI
For uWSGI, the NGINX configuration looks like this:
server {
lib/Dancer2/Manual/Keywords.pod view on Meta::CPAN
Deprecated. Use L</push_response_header> instead.
B<When to use>: Don't. Use L</push_response_header>.
B<Related Keywords>: L</push_response_header>.
=head2 L<push_response_header|Dancer2::Manual/"Adding Additional Response Headers">
Adds a new value to an existing response header without replacing its current value.
B<When to use>: Append additional values to headers like 'Set-Cookie' or 'X-Forwarded-For'.
B<See also>: L</response_header>, L</response_headers>
=head2 L<redirect|Dancer2::Manual/redirect>
Redirects the client to a different location.
B<When to use>: Redirect users to another route or external URL.
B<Related Keywords>: L</status>
lib/Dancer2/Manual/Tutorial.pod view on Meta::CPAN
improve the security and performance of our application:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
If this server is public facing, you should also configure it with HTTPS;
L<Let's Encrypt/https://letsencrypt.org> makes this free and easy.
More advanced setups are possible (like serving static content from NGINX
instead of Dancer2), but that is beyond the scope of this tutorial.
=head1 What You've Built
( run in 0.351 second using v1.01-cache-2.11-cpan-39bf76dae61 )