Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative url path is ignored #143

Open
suryateja619 opened this issue Aug 7, 2018 · 2 comments
Open

Relative url path is ignored #143

suryateja619 opened this issue Aug 7, 2018 · 2 comments

Comments

@suryateja619
Copy link

We have relative URL path setup for the web server in prod. The links in the resque_web interface are not honoring the relative URL path when the links are clicked in the web. Is there any setting where we can fix it?

@mlh758
Copy link

mlh758 commented Jul 17, 2019

I made an alternative project that works under a relative url. Check it out here

@ravimisra
Copy link

ravimisra commented Feb 26, 2021

What worked for me is:

  1. Mount ResqueWeb in config/routes.rb as follows:

    require "resque_web"
    Rails.application.routes.draw do
      mount ResqueWeb::Engine => "/resque/"
      root 'resque_web/overview#show'
    end
    
  2. set relative URL root in config/application.rb:

    config.relative_url_root = '/resque'
    
  3. update Nginx config as follows

    location ~ ^/resque/(.*|$) {  		
         alias /home/ravi/ws/ror/resque-web/public$1; 
         passenger_app_root /home/ravi/ws/ror/resque-web;
         passenger_document_root /home/ravi/ws/ror/resque-web/public;
         passenger_enabled on;
         passenger_app_env development;
     }
    

Every link on the resque dashboard is generated with prefixed /resque e.g. /resque/workers points to list of workers i.e. resque_web/workers#index

my rake routes output is:

Prefix Verb URI Pattern Controller#Action
resque_web      /resque     ResqueWeb::Engine
	  root GET  /           resque_web/overview#show

Routes for ResqueWeb::Plugins::ResqueScheduler::Engine:
	      schedules GET    /schedule(.:format)                     resque_web/plugins/resque_scheduler/schedules#index
	        requeue POST   /schedule/requeue(.:format)             resque_web/plugins/resque_scheduler/schedules#requeue
requeue_with_params POST   /schedule/requeue_with_params(.:format) resque_web/plugins/resque_scheduler/schedules#requeue_with_params
	       schedule DELETE /schedule(.:format)                     resque_web/plugins/resque_scheduler/schedules#destroy
	        delayed GET    /delayed(.:format)                      resque_web/plugins/resque_scheduler/delayed#index
  delayed_job_class GET    /delayed/jobs/:klass(.:format)          resque_web/plugins/resque_scheduler/delayed#jobs_klass
	 delayed_search POST   /delayed/search(.:format)               resque_web/plugins/resque_scheduler/delayed#search
	      timestamp GET    /delayed/:timestamp(.:format)           resque_web/plugins/resque_scheduler/delayed#timestamp
	      queue_now POST   /delayed/queue_now(.:format)            resque_web/plugins/resque_scheduler/delayed#queue_now
	     cancel_now POST   /delayed/cancel_now(.:format)           resque_web/plugins/resque_scheduler/delayed#cancel_now
	          clear POST   /delayed/clear(.:format)                resque_web/plugins/resque_scheduler/delayed#clear

Routes for ResqueWeb::Engine:
resque_web_plugins_resque_scheduler        /scheduler                      ResqueWeb::Plugins::ResqueScheduler::Engine
	                       overview GET    /overview(.:format)             resque_web/overview#show
	                  working_index GET    /working(.:format)              resque_web/working#index
	                    clear_queue PUT    /queues/:id/clear(.:format)     resque_web/queues#clear {:id=>/[^\/]+/}
	                         queues GET    /queues(.:format)               resque_web/queues#index
	                          queue GET    /queues/:id(.:format)           resque_web/queues#show {:id=>/[^\/]+/}
	                                DELETE /queues/:id(.:format)           resque_web/queues#destroy {:id=>/[^\/]+/}
	                        workers GET    /workers(.:format)              resque_web/workers#index
	                         worker GET    /workers/:id(.:format)          resque_web/workers#show {:id=>/[^\/]+/}
	                  retry_failure PUT    /failures/:id/retry(.:format)   resque_web/failures#retry
	             retry_all_failures PUT    /failures/retry_all(.:format)   resque_web/failures#retry_all
	           destroy_all_failures DELETE /failures/destroy_all(.:format) resque_web/failures#destroy_all
	                       failures GET    /failures(.:format)             resque_web/failures#index
	                        failure GET    /failures/:id(.:format)         resque_web/failures#show
	                                DELETE /failures/:id(.:format)         resque_web/failures#destroy
	                          stats GET    /stats(.:format)                resque_web/stats#index
	                   stats_resque GET    /stats/resque(.:format)         resque_web/stats#resque
	                    stats_redis GET    /stats/redis(.:format)          resque_web/stats#redis
	                     stats_keys GET    /stats/keys(.:format)           resque_web/stats#keys
	                 keys_statistic GET    /stats/keys/:id(.:format)       resque_web/stats#keys {:id=>/[^\/]+/}
	                           root GET    /                               resque_web/overview#show

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

No branches or pull requests

3 participants