Rails 3 - Whitelisting list of IPs via routes

前端 未结 4 1025
半阙折子戏
半阙折子戏 2020-12-29 11:18

This is a two part question. I\'m needing to restrict a rails site that I\'m throwing on development server to only a few IP addresses, so the public can\'t access it. (Basi

4条回答
  •  别那么骄傲
    2020-12-29 12:04

    Or simply use apache's .htaccess:

    1. Add the following to the http.conf or whatever conf file you have for apache and your rails app

    AllowOverride all

    1. Create a file .htaccess in the rails folder and add the following
    Allow from xxx.xxx.xxx.xxx
    Deny from all
    

提交回复
热议问题