Update reverse proxy guide

This commit is contained in:
Eugene Burmakin 2024-07-08 23:19:25 +02:00
parent c8d89c9d7e
commit 4f25c81a93
3 changed files with 30 additions and 14 deletions

View file

@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.8.4] — 2024-07-08
## [0.8.6] — 2024-07-08
### Added
- Guide on how to setup a reverse proxy for Dawarich in the `docs/how_to_setup_reverse_proxy.md` file. This guide explains how to set up a reverse proxy for Dawarich using Nginx and Apache2.
---
## [0.8.5] — 2024-07-08
### Fixed

View file

@ -12,9 +12,8 @@ class ReverseGeocodingJob < ApplicationJob
result = Geocoder.search([point.latitude, point.longitude])
return if result.blank?
point.update!(
city: result.first.city,
country: result.first.country
)
point.update!(city: result.first.city, country: result.first.country)
rescue ActiveRecord::RecordNotFound => e
Rails.logger.error("Point with id #{point_id} not found: #{e.message}")
end
end

View file

@ -1,27 +1,36 @@
## Setting up reverse proxy
### Environment Variable
To make Dawarich work with a reverse proxy, you need to ensure the APPLICATION_HOST environment variable is set to the domain name that the reverse proxy will use.
For example, if your Dawarich instance is supposed to be on the domain name timeline.mydomain.com, then set the environment variable to "timeline.mydomain.com".
Make sure to exclude "http://" or "https://" from the environment variable. The webpage will not work if you do include http:// or https:// in the variable.
To make Dawarich work with a reverse proxy, you need to ensure the APPLICATION_HOSTS environment variable is set to include the domain name that the reverse proxy will use.
For example, if your Dawarich instance is supposed to be on the domain name timeline.mydomain.com, then include "timeline.mydomain.com" in this environment variable.
Make sure to exclude "http://" or "https://" from the environment variable. ⚠️ The webpage will not work if you do include http:// or https:// in the variable. ⚠️
At the time of writing this, the way to set the environment variable is to edit the docker-compose.yml file. Find all APPLICATION_HOST entries in the docker-compose.yml file and change them from "localhost" to your domain name.
For a synology install, refer to **[Synology Install Tutorial](How_to_install_Dawarich_on_Synology.md)**. In this page it is explained how to set the APPLICATION_HOST environment variable.
At the time of writing this, the way to set the environment variable is to edit the docker-compose.yml file. Find all APPLICATION_HOSTS entries in the docker-compose.yml file and make sure to include your domain name. Example:
```yaml
dawarich_app:
image: freikin/dawarich:latest
container_name: dawarich_app
environment:
APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1"
```
For a Synology install, refer to **[Synology Install Tutorial](How_to_install_Dawarich_on_Synology.md)**. In this page, it is explained how to set the APPLICATION_HOSTS environment variable.
### Virtual Host
Now that the app works with a domain name, the server needs to be setup to use a reverse proxy. Usually this is done by setting it up in the virtual host configuration.
Now that the app works with a domain name, the server needs to be set up to use a reverse proxy. Usually, this is done by setting it up in the virtual host configuration.
Below are examples of reverse proxy configurations.
### Nginx
```
server {
listen 80;
listen [::]:80;
server_name example.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -29,7 +38,7 @@ server {
proxy_set_header X-Forwarded-Server $host;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:3000/;
}